Deploy a Node App to Heroku
I couldn’t find instructions for deploying non-express Node apps.
This will help you deploy a node app to Heroku without a framework.
1. Create Heroku App
heroku create
2. Add Procfile
1
|
|
Tell Heroku how to start your server.
3. Add package.json
1 2 3 4 5 6 7 8 9 10 |
|
List your dependencies
4. Use Heroku PORT
1 2 3 |
|
Give port preference to Heroku wth the process.env.PORT
environment variable
Notes
Make sure that you commit your changes before pushing.
You may need to run
heroku restart
after deploying.