Reputation: 1608
Do i still to configure nginx if I want to deploy my node.js application on Heroku? or Heroku already handle that part?
If I do need to configure, what are the steps? for those of you who have experienced deploying it on heroku, could you guide me. This will be my first time deploying something for real :)
Thank you
Upvotes: 1
Views: 818
Reputation: 5220
Heroku handles the proxy between your app to port 80 (or SSL port when applicable) for you. But the port for your app is not fixed, it is potentially variable but always available as an Environment Variable PORT
.
So in your node.js app, you should listen to process.env.PORT
instead of a fixed value. Further, to make the app run both locally and on Heroku environment, you can do process.env.PORT || 3000
assuming 3000 is your choice of the port number for local development purposes.
See https://devcenter.heroku.com/articles/dynos#local-environment-variables for further details.
Upvotes: 1