kongkong
kongkong

Reputation: 333

Meteor.js how to run multiply web apps on one port

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!

Upvotes: 1

Views: 621

Answers (4)

AJ Acevedo
AJ Acevedo

Reputation: 1268

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

Upvotes: 0

nicolsondsouza
nicolsondsouza

Reputation: 426

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

Upvotes: 0

Curious2learn
Curious2learn

Reputation: 33608

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.

Upvotes: 1

Andrew Mao
Andrew Mao

Reputation: 36900

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.

Upvotes: 2

Related Questions