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
1.7 KiB
Steps to Create and Deploy:
set up local
in your browser
- fork this repo
in your terminal
- clone your fork of this repo onto your local computer somewhere outside the class repo
cdinto the local repo- open your postgres app and start the db server
- back in the, run
nodemon
if you deleted your old "contacts" database from class
- in the postgres app, double click one of the existing databases to enter
psql - once inside
psql, run:CREATE DATABASE contacts;\c contactsCREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );
set up heroku
in your terminal
- run
heroku create - run
git push heroku master
in your browser
- go to heroku.com in your browser and sign in
- find this newly created heroku app in your list of available apps and click on it
- go to resources
- search for postgres and choose Heroku Postgres
- choose "Hobby Dev - Free"
- click provision
in your terminal
- in your terminal, if running
psqlgives you "command not found", runln -s /Applications/Postgres.app/Contents/Versions/latest/bin/psql /usr/local/bin/psql - run
heroku pg:psql - once inside heroku's psql, run
CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );
- exit heroku psql with
\q - run
heroku opento see app