I would like to know how best to connect multiple node.js apps which all run as http servers.
For example: I have an express node.js app called MasterApp. This should handle authentication, user accounts, landing page, etc. But I also wish to have other apps which do specific area of the website like, say, a Wiki and a chat room.
So effectively my set could look something like below:
Web
^
|
MasterApp
^ ^
| |
ServiceApp1 ServiceApp2...
One possible solution would be to turn the smaller apps into modules and include them in the MasterApp – but I have reasons not to do this. One being I want to maintain uptime on the MasterApp while ServiceApp1 and ServiceApp2 in experimental and/or in development.
Another solution, which seems sensible, would be to create a proxy in MasterApp with node-http-proxy which forwards requests after an authentication layer to ServiceApp1, ServiceApp2... Is this an advisable solution? Or is it ill-advised?
Or it there another solution, something that I am missing. Or, am I on the right track to use a proxy but perhaps HAProxy should be used instead, keeping the proxy external to node (although I like the idea of being able to dynamically configure node-http-proxy).
Thanks