Deploy Node App on Heroku

Hari Kishore
1 min readApr 12, 2020

Heroku is a platform where we can deploy our apps for free. There are many official language that heroku supports and from the user point of view we are always in search of something free which lets us deploy our projects so that we can show it to world.

So, without any further ado, you can follow these steps. (There are plenty of good tutorials which you can follow if you want detailed theories and all).

Steps:

  1. Create a Heroku accoount if you dont have one, and Login.
  2. Create New APP -> Enter App Name . (app will be created. Click open to see the app url)
  3. Following changes needs to be done in your project
  • Change Port

const port = process.env.PORT || 5000;

  • Change package.json

“scripts”: {

“start”: “node app.js”

}

Install the Heroku CLI

Download and install the Heroku CLI.

If you haven’t already, log in to your Heroku account and follow the prompts to create a new SSH public key.

$ heroku login

Clone the repository

Use Git to clone hello-node-hari’s source code to your local machine.

$ heroku git:clone -a hello-node-hari
$ cd hello-node-hari

Deploy your changes

Make some changes to the code you just cloned and deploy them to Heroku using Git.

$ git add .
$ git commit -am "make it better"
$ git push heroku master

Done. Visit you app site. Hurray! your project is up now.

--

--