You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.7 KiB

Steps to Create and Deploy:

set up local

in your browser

  1. fork this repo

in your terminal

  1. clone your fork of this repo onto your local computer somewhere outside the class repo
  2. cd into the local repo
  3. open your postgres app and start the db server
  4. back in the, run nodemon

if you deleted your old "contacts" database from class

  1. in the postgres app, double click one of the existing databases to enter psql
  2. once inside psql, run:
    1. CREATE DATABASE contacts;
    2. \c contacts
    3. CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);
    4. INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );
    5. INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );
    6. INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );

set up heroku

in your terminal

  1. run heroku create
  2. run git push heroku master

in your browser

  1. go to heroku.com in your browser and sign in
  2. find this newly created heroku app in your list of available apps and click on it
  3. go to resources
  4. search for postgres and choose Heroku Postgres
  5. choose "Hobby Dev - Free"
  6. click provision

in your terminal

  1. in your terminal, if running psql gives you "command not found", run ln -s /Applications/Postgres.app/Contents/Versions/latest/bin/psql /usr/local/bin/psql
  2. run heroku pg:psql
  3. once inside heroku's psql, run
    1. CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);
    2. INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );
    3. INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );
    4. INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );
  4. exit heroku psql with \q
  5. run heroku open to see app