-
Create new web project
-
Initialize the folder with git
git init .
- Initialize it with npm
npm init
-
Add engines and start script in package.json
-
Create account on heroku.com
-
Install heroku cli
npm i -g heroku-cli
- To create app:
heroku apps:create <appname>
- To add addons:
heroku addons:add <addonname>:<planname>
eg:
heroku addons:add heroku-postgresql:hobby-dev
-
Create config:
5.1) Change from hardcoded port to 'process.env.PORT'
5.2) Change from hardcoded db_url to 'process.env.DATABASE_URL'
-
To push to heroku
git push heroku master
After connecting github repository and heroku:
git push origin master