I’ll introduce how to deploy an existing Express.js project to Heroku.
express --view=pug expressjs-sandbox
After running this command and making several commits, I’ll create a Heroku app and deploy the existing Express.js app.
📁codenote-net/expressjs-sandbox: My Express.js sandbox
Add a Procfile with the following content:
web: npm start
Here’s the git commit:
📁Add Procfile for Heroku · Pull Request #6 · codenote-net/expressjs-sandbox
Finally, create a Heroku app and git push to complete the deployment.
heroku create expressjs-sandbox
git push heroku master
heroku open # Open https://expressjs-sandbox.herokuapp.com/
You can check the result at https://expressjs-sandbox.herokuapp.com/.
That’s all from the Gemba.