Skip to content

Instantly share code, notes, and snippets.

@kimschles
Last active April 26, 2018 17:55
Show Gist options
  • Select an option

  • Save kimschles/03a23c07162da7a2a3dc2d87e18d1111 to your computer and use it in GitHub Desktop.

Select an option

Save kimschles/03a23c07162da7a2a3dc2d87e18d1111 to your computer and use it in GitHub Desktop.
How to deploy an node, express and postgres backend to heroku
  1. Create a new heroku remote
  • heroku create
  1. Push your code to heroku
  • git push heroku master
  1. Add the heroku postgres addon
  • heroku addons:create heroku-postgresql:hobby-dev
  1. Open your heroku app from the command line
  • heroku open
  1. Run knex migrations
  • heroku run knex migrate:latest
  1. Seed the db
  • heroku run knex seed:run
  1. Look at your data!
  • heroku pg:psql
  • \dt
  • select * from <table_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment