DEV Community

loading...

Discussion on: I'm a Meteor developer, Ask Me Anything!

Collapse
cmrickels profile image
Colin Rickels

Sorry to continue asking such in depth questions but your extremely knowledgeable so im going to take advantage of that ha! Im building my external API on meteor and had just transferred from using meteorhacks/Picker for server side routes to Express.js. My problem is express needs to listen on a port so i assign it listen to the same port that meteor is. This of course causes me to have issues when trying to visit any routes on my client side router or just my root domain. Would it make since at all to have express listen on port 4000 if meteor is on 3000? My first assumption whas that there would be an issue making mongo queries if on a different port then meteor but it seems to be working ok. Just curious if this is a bad choice or if you think it would turn out ok in production?

Collapse
guidouil profile image
Guidouil ツ Ask Me Anything

Sorry for the late reply, I did not see your question...
Usually in production I don't relie on port but sub domains.
Port stays a requirent but you hide that with NginX proxying all https connection to whatever port you want/defined
On localhost you (usually) don't have subdomain or nginx setup so just start a local mongo server and start your meteor app with MONGO_URL='mongodb://127.0.0.1:27017' && meteor -p 4000
This will run the meteor app on port 4000 and won't make the meteor start a mongo :)