Monday 22 June 2020

Help understanding running multile servers in production.

So im a little confused how things work when i'm hosting on let's say Heroku.Here is my Github for this project which i am referencing.https://github.com/TarikGul/portfolio​So Im confused how multiple servers run at the same time and how Heroku detects it. So in my app.js express is listening on port 5000. In my package.json, i refer to my 'main' as app.js which i'm assuming runs the file and then the server is created and starts listening. But i also need to run a separate server on port 1337 for my webhook that is receiving messages from Twilio which is in routes/api/message_server.js.When im in development, i just run the file and it listens and im able to run tests etc. But in production how do i get that server up and running so i can listen on port 1337 as well as port 5000.Would I just import the app from message_server.js into app.js and listen from there?If there is anything else i can provide please let me know. Thanks again.

Submitted June 23, 2020 at 01:52AM by himurax3x

No comments:

Post a Comment