heroku login is required once
heroku login
Add The version of Node.js to Your package.json file:
"engines": {
"node": "10.x"
},
create a Procfile
file inside the root directory of the project and add the below code in it
web: node app.js
By default, Heroku will look into our package.json file under the scripts section and grab start. Sometimes we won't have that defined or it will be different than what we want the server to execute. We can specify the exact command we want by creating a Procfile
heroku create
This will create a random name for our application
heroku apps:rename new-name --app old-app-name
heroku local web
git push heroku master
To provide a local development environment, create a .gitignore’d .env file, which will be loaded by heroku local:
DATABASE_URL='postgres://localhost/foobar'
HTTP_TIMEOUT=10000
Now start your app with heroku local, and it will automatically pull in these environment variables into your app under process.env.DATABASE_URL and process.env.HTTP_TIMEOUT.
set all of your env variables and you are done
heroku config:set GITHUB_USERNAME=joesmith