Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
In project:
1. Double check that package.json has a start script
In command line, in PROJECT folder - add Heroku:
2. which heroku
3. heroku create herokuSiteName
4. git remote -v (shows you the heroku remote)
In command line, in PROJECT folder - add DB to Heroku:
5. heroku addons:create heroku-postgresql
6. heroku config (shows database)
7. git push heroku master
In atom/text editor, in PROJECT folder - modify connection:
8. open atom - open knexfile.js
9. add production: Connection = heroku link + ?ssl=true
In command line, in PROJECT folder - migrate and seed the deployed DB:
10. knex migrate:latest --env production
11. knex seed:run --env production
In command line, in PROJECT folder - add dotenv
12. npm install --save dotenv
In atom/text editor- set environment variables
13. create .env file
14. set DB_URL=link
In atom/text editor- update app.js
15. require('dotenv').config()
In atom/text editor- update knexfile.js with config/environment:
16. const environment = process.env.NODE_ENV || 'development’
17. const config = require('../knexfile.js')[environment]
18. create .gitignore File:
Leave instructions for hooking up a DB to the project:
19. cp .env .env.example (for reaadme example)
20. Remove yoru data from .env.example
21. Add a comment to link the db in that file
22. git add, commit, push
23. git push heroku master
24. heroku open
25. if error: heroku logs
git push heroku dev:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment