-
Install dependencies
npm install
-
Setup PostgreSQL DB:
- Install Docker if you don't already have it.
- Create and start a new Docker PostgreSQL Container:
npm db:create_container
- Seed the DB:
npm db:seed
-
start development server:
- create and configure .env file (see .env.example)
- start the server:
npm run dev
-
start production server:
npm run start
-
Create new user: make a post request to /signup with a json body like
{ "username":"abc", "password": "def"}
-
Sign in: make a post request to /signin with a json body like
{ "username":"abc", "password": "def"}
.- If the credential are valid the server responds a json with a api token:
{ "success": true, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJwbGFuIjoiZnJlZSIsImlzcyI6ImxvY2FsaG9zdDozMDAwIiwiaWF0IjoxNTE4OTgxMTk5LCJleHAiOjE1MTg5ODQ3OTl9.882VgD1UdebAQONZZbouYUqHLl_mWE4v3ABlyWZrRro" }
- Use this token in the Header of all API requests: Authorization: Bearer <your_token>
-
Access API Endpoint of your choice ✌