-
To install required dependencies run
yarn
-
Update the variables in
.env
&&.env.test
with your values
-
Dev server port:
3000
-
Dev db port:
5432
-
Test server port:
3000
-
Test db port:
5432
- Create user
Create User 3to1dash With Password '5937865562';
- Create the development and test databases
Create database shopfront_api;
Create database shopfront_api_test;
- Grant all databases privileges to user in both databases
Grant All Privileges On Database shopfront_api To 3to1dash;
Grant All Privileges On Database shopfront_api_test To 3to1dash;
-
To run the development migrations
$ npm run db:up
-
To run build and run the server
$ npm run server
After finishing testing the api run:
-
To drop the development database
$ npm run db:drop
To check the api endpoints and the database tables open: REQUIREMENTS.md.
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
POSTGRES_USER=3to1dash
POSTGRES_PASSWORD=5937865562
POSTGRES_DB=shopfront_api
ENV=dev
BCRYPT_SECRET=cobalt-giraffe-25
SALT_ROUNDS=10
TOKEN_SECRET=manurus2684!
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
POSTGRES_USER=3to1dash
POSTGRES_PASSWORD=5937865562
POSTGRES_DB=shopfront_api_test
ENV=test
BCRYPT_SECRET=cobalt-giraffe-25
SALT_ROUNDS=10
TOKEN_SECRET=manurus2684!
-
To run build and run the server
$ npm run server:test
-
To run the test Suites
$ npm run test