Boilerplate code for quick setup for CRUD applications using express/knex/postgres/jest/supertest
Boilerplate code for quick setup for CRUD applications using express/knex/postgres/jest/supertest
##Setup - Detailed Instructions Below
git clone [url] and remove origin git remote remove originnpx knex migrate:latestnpx knex seed:runIf you dont have postgres follow this link (Follow directions until you’re able to get into psql utility): https://www.codementor.io/engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb
In terminal run the following commands:
psql – To get into postgreSQL utilityCREATE DATABASE db-name; – Creates development serverCREATE DATABASE db-name-test; – Creates testing server\qIf you dont have postgres follow this link: https://www.2ndquadrant.com/en/blog/pginstaller-install-postgresql/
Set up Postgres and create databases for both the development server (db-name) and testing server (db-name-test)
Create a “.env” file at the root of your project and add the following for both DEV and TEST databases
POSTGRES_DEV_HOST=localhost
POSTGRES_DEV_PORT=5432
POSTGRES_DEV_USER=postgres
POSTGRES_DEV_PASSWORD= \_Insert your postgres password here*
POSTGRES_DEV_DATABASE=db-name
POSTGRES_TEST_HOST=localhost
POSTGRES_TEST_PORT=5432
POSTGRES_TEST_USER=postgres
POSTGRES_TEST_PASSWORD= \_Insert your postgres password here*
POSTGRES_TEST_DATABASE=db-name-test