This app is using Heroku for deployment. The Heroku CLI is required.
- Create a Heroku account
- Download the Heroku CLI
- Login to the Heroku CLI by using
heroku login
- (DO NOT DO THIS AGAIN UNLESS NEW PROJECT) Create a new heroku app by running
heroku create
. Use the 2nd link and add it as a remote origin (below one is the one ). - Add remote heroku through
git remote add heroku {the 2nd link}
. The one for my app ishttps://git.heroku.com/obscure-gorge-31285.git
.
The dynamic port is provided by Heroku via an enviromnent variable. For basic development work, the port is 5000.
We must tell Heroku what versions of Node and NPM to use. This is specified in the package.json
file like so:
"engines": {
"node": "8.8.1",
"npm": "5.0.3"
}
We need to instruct Heroku how to start up our server. This is specified in the package.json
file like so:
"scripts": {
"start": "node index.js"
}
To deploy, simply run git push heroku master
. To test the deployment, run heroku open
. heroku logs
will print out the logs in case of any errors.