Express
TypeScript
Jasmine and Super set for testing
PostgreSQL
Restful API
- npm install
- npm run dev
- npm run start
- npm run test
- npm run lint
- npm run format
- npm run watch
We shall create the dev and test database.
- connect to the default postgres database as the server's root user
psql -U postgres
- In psql run the following to create the dev and test database
CREATE DATABASE storefront_dev;
CREATE DATABASE storefront_test;
- Connect to the databases and grant all privileges using pgadmin
Navigate to the root directory and run the command below to migrate the database
db-migrate up -c 5
Bellow are the environmental variables that needs to be set in a .env
file. This is the default setting that I used for development, but you can change it to what works for you.
PORT=3000
POSTGRES_HOST=127.0.0.1
POSTGRES_DB=storefront_dev
POSTGRES_TEST__DB=storefront_test
POSTGRES_USER=postgres
POSTGRES_PASSWORD=8773
ENV=dev
SALT_ROUNDS=1
TOKEN_TEST = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImZpcnN0bmFtZSI6ImFzZCIsImxhc3RuYW1lIjoiYXNkIn0sImlhdCI6MTY1MTM3MDk1NX0.Ik3sQnSCWshS7fPDepmY6A0EU7XqMZJHLdE94__Popo.e30.J8BgsyqA3Y6F71NXbfuYIfRVuvRa_qb08RStxrCVhlQ
TOKEN_SECRET = ####
After start up, the server will start on port 3000
and the database on port 5432
All endpoints are described in the REQUIREMENT.md file.
Tokens are passed along with the http header as
Authorization Bearer <token>