Install node and npm.
Install postgresql.
Install source code.
git clone [email protected]:s2t2/express-robots.git
cd express-robots/
npm installCreate database user.
psql
CREATE USER robot WITH ENCRYPTED PASSWORD 'r0b0t!';
ALTER USER robot CREATEDB;
ALTER USER robot WITH SUPERUSER;
\qCreate database.
psql -U robot --password -d postgres -f $(pwd)/db/create.sqlMigrate database.
knex migrate:latest --knexfile db/config.jsSeed the database.
knex seed:run --knexfile db/config.jsStart the server and visit localhost:3000 in a browser.
DEBUG=robots_app:* npm startSet environment variable(s). Setting NODE_ENV is technically unnecessary because heroku does it automatically during deploy.
heroku config:set NODE_ENV=production SESSION_SECRET=s0m3l0ngstr1ng123456Ensure postgresql addon is installed.
heroku addons:create heroku-postgresql:hobby-devDeploy.
git push heroku masterCreate, migrate, and seed production database (NOTE: this is already happening as post-installation scripts in package.json).
heroku pg:reset DATABASE
heroku run NODE_ENV=production knex migrate:latest --knexfile db/config.js
heroku run NODE_ENV=production knex seed:run --knexfile db/config.js