JavaScript Nodejs

How to Deploy Node.js Web App to Heroku from Bitbucket

Spread the love

Note that the Git command is pushing a subfolder to Heroku, but you can push the root folder as well.

Then we to make a Procfile in the root folder of the back end app.\

release: npx sequelize db:migrate  
release: npm install -g sequelize-cli forever  
release: npm i  
web: node app.js

In this example, migrations are run, then packages are installed and the app is restarted.

Once you push your code in the branch you specified in the BITBUCKET_BRANCH variable, then all the commands you specified in the Procfile will run. The build steps are specified in the release: lines and the line running the web app is specified in the web: line of the Procfile .

Once the Procfile commands finished running, your app will be running.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *