1

I have two web apps app1 and app2, and I want to run the two apps on my local port 3000,like this:

http://localhost:3000/app1
http://localhost:3000/app2

Any help will be appreciated.Thanks in advance!

kongkong
  • 333
  • 1
  • 3
  • 12
  • What's the use case? Asides trying to avoid extra hosting costs by running several apps of one node/meteor instance? – booyaa Sep 25 '13 at 14:14
  • Just put them on different ports on the same box, but behind a reverse proxy like nginx. See my configuration [here](http://stackoverflow.com/questions/18003689/recommended-nginx-configuration-for-meteor). – David Weldon Sep 25 '13 at 14:29

4 Answers4

2

Why don't you just use Iron Router and create routes corresponding to templates for each of the functions you want your apps to have? There's no reason to physically separate them into different servers.

This way, you can still have the same set of users across both "apps" and share code between them.

If you still insist on separating them and run them on the same port and same server (I don't understand why you would do such a thing), I think you'll need a reverse proxy (Apache, nginx) which handles the apps by path and directs them to the appropriate server. This will likely break the default settings on Meteor.

Andrew Mao
  • 35,740
  • 23
  • 143
  • 224
  • Router is good. But if I have two completely different WEB apps, I don't need share anything between them. – kongkong Sep 25 '13 at 05:50
  • Reverse proxy is the answer. Maybe he wants to run them both on port 80 and doesn't have the funds to pay for two separate servers right now. I don't think it's as such a far-fetched idea as you implied in your answer. – Dave Sep 25 '13 at 14:30
  • @Dave even if you want to run two web apps, you don't need two physical separate servers to run them. Apache can run any number of virtual hosts all on port 80, for example. The idea is not far-fetched; it just doesn't make sense for Meteor. – Andrew Mao Sep 25 '13 at 16:09
1

Can you host the apps on different ports, say 3000 and 5000? Once you have done that, one option is to use the appropriate port to navigate to the desired app.

If you have all incoming profit going to one port, for example port 80, then you can internally use nginx, node-http-proxy or bouncy to route the traffic to the appropriate port and app.

Curious2learn
  • 31,692
  • 43
  • 108
  • 125
0

This is how I did it,
disabled reload manually from the reload package
and then there were multiple version of the app
on multiple devices

nicolsondsouza
  • 426
  • 3
  • 15
0

This can be achieved by using Phusion Passenger. Passenger will allow you to run multiple Meteor processes and Nginx can handle the port and domain forwarding.

Checkout Phusion Passenger

AJ.
  • 1,248
  • 10
  • 27