diff --git a/README.md b/README.md index fe1ec89..3ac5615 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,28 @@ # Installation ## Locally * postgres server installed and running - * `brew install postgres` - * `pg_ctl -D /usr/local/var/postgres start` -* heroku cli installed - * `brew install heroku` + * `brew install postgres` + * `pg_ctl start -D /usr/local/var/postgres` * golang installed - * `brew install go` -* godep installed: - * `go get github.com/tools/godep` + * `brew install go` +* godep installed: + * `go get github.com/tools/godep` +* create database + * `psql -d postgres -c "create database cerealnotes_test"` + * Refer to `migrations/README.md` to create relevant database tables +* export environment variables + ``` + export DATABASE_URL=postgres://localhost:5432/cerealnotes_test?sslmode=disable + export TOKEN_SIGNING_KEY=abcdefg + export PORT=8000 + ``` +* run the app + * `go build && ./cerealnotes` ## Heroku +* heroku cli installed + * `brew install heroku` * heroku instance -* instance connected to postgres db # Running CerealNotes diff --git a/migrations/README.md b/migrations/README.md index 9111fcf..daa69b1 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -1,9 +1,9 @@ -# Locally: -1. first make sure that postgres is running. - * If installed via homebrew on a macOS: `pg_ctl -D /usr/local/var/postgres start` +# Locally: +1. first make sure that postgres is running. + * If installed via homebrew on a macOS: `pg_ctl start -D /usr/local/var/postgres` 2. then run migration locally * `psql < *MIGRATION_NAME*` -# On Heroku: +# On Heroku: 1. `heroku pg:psql < *MIGRATION_NAME*`