Easily run your backend server code in node.js on HEROKU

Photo by Umberto on Unsplash

I believe that whoever wants to run their server on Heroku is having their server.js file ready and running on their local machine.

Steps

# Goto the package.json file and node version you are using like shown below.

# Create a Procfile (with P capital )in the root directory of your backend application, with content,

web: node server.js

//server.js is to be replaced by your file name

# Push your code to Github and then goto Heroku and select Github for deployment and select the branch and deploy.

Thats it.

Learning each day without giving up.