Created
October 11, 2018 01:04
Revisions
-
tphdev created this gist
Oct 11, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ 1) Create Heroku Account - https://signup.heroku.com/dc 2) Install Heroku CLI - https://devcenter.heroku.com/articles/heroku-cli#download-and-install 3) Create Heroku App - heroku create «your app name» - check `heroku -v` 4) Create Postgres database for app - `add-on- heroku addons:create heroku-postgresql:hobby-dev` 5) Deploy Heroku App 6) Additional Steps - `knexfile.js` ```js // ... const productionConfig = Object.assign( {}, devConfig, { connection: process.env.DATABASE_URL } ) module.exports = process.env.NODE_ENV === 'production' ? productionConfig : devConfig ``` - `server.js` ```js const PORT = process.env.NODE_ENV === 'production' ? process.env.PORT : 3000 //.... const appDb = knex( dbConfigObj ) ``` 7) Migrations + Seeds ``` heroku run knex migrae:latest heroku run knex seed:run ```