If we have several mobile apps with different Restful web services based on LoopBack and MongoDB how could we run these projects in same time in VPS to address mobile apps and web apps to connect and uses services.
It is not important that all web services using same port or different port numbers its important that we can address them differently, something like:
http://82.25.14.23/App1/api/Rerification
http://82.25.14.23/testapp2/api/registration
http://82.25.14.23/PazarWebApp/api/catagories
The question is more related to the server configuration itself, rather than Loopback. I do this in several production servers. Here are some tips:
<VirtualHost *:80>
ServerName dev.example.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001
ProxyPreserveHost on
</VirtualHost>
So that the Loopback app running at port 3001 will be mapped at dev.example.com.
www.example.com/dev... Trust me it is generally better to use a subdomain, it is easier to mantain, easier to understand and easier to implement. You would end up with:app1.example/api
testapp2,example.com/api
PazarWebApp.example.com/api
and so on...
If you want to use addresses like you mentioned look for "reverse proxy in subdirectory".
Hope these insights are helpful.
Most helpful comment
The question is more related to the server configuration itself, rather than Loopback. I do this in several production servers. Here are some tips:
So that the Loopback app running at port 3001 will be mapped at
dev.example.com.www.example.com/dev... Trust me it is generally better to use a subdomain, it is easier to mantain, easier to understand and easier to implement. You would end up with:app1.example/api
testapp2,example.com/api
PazarWebApp.example.com/api
and so on...
If you want to use addresses like you mentioned look for "reverse proxy in subdirectory".
Hope these insights are helpful.