In this assignment, you'll deploy your database-driven application to Heroku.
Refer to the steps below. I also made a little video going through the process: https://vimeo.com/207720558
First, complete the following pre-deployment steps.
- Create a Heroku app called
USERNAME-galvanize-bookshelf
whereUSERNAME
is your GitHub username in lowercase form. - Generate a cryptographic key for the JWT signature and set it to the
JWT_KEY
config variable of the new Heroku app. - Update the
package.json
file with a dependency to a specific Node.js version. - Enable the Heroku PostgreSQL add-on for the new Heroku app.
- Update the
knexfile.js
file with theproduction
database connection information. - Update the
package.json
file with aheroku-postbuild
script to migrate the production database. - Remember that you have two choices for specifying what script to run to start your server: profile (https://devcenter.heroku.com/articles/getting-started-with-nodejs#define-a-procfile) or the start script in package.json (if no procfile is found). In this repo nodemon is devDependency which will not be included in the default heroku environment.
- Add and commit the changes to your local git repository.
- Push the changes to the
master
branch on GitHub.
Next, complete the following deployment steps.
- Push the changes to the
master
branch on Heroku. - Seed the production database with
npm run knex seed:run
as a one-off Heroku command. - Visit the Heroku app at
https://USERNAME-galvanize-bookshelf.herokuapp.com/
. - If the application isn't working, check the production logs with
heroku logs
. - Otherwise, celebrate with a beverage of choice!
Finally, complete the following post-deployment steps.
- Add
https://USERNAME-galvanize-bookshelf.herokuapp.com/
to your Github repository's URL. - Fix any test errors, including bonus tests, with
npm test
. Note that this at the moment can only be run in your local environment. - Fix any linting errors with
npm run lint .
. - Submit your solution for grading.
Use the Heroku Scheduler add-on to seed the production database with npm run knex seed:run
every hour.
Once you're satisfied, find a classmate and see if that person would like some help.