Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 1.06 KB

README.md

File metadata and controls

83 lines (60 loc) · 1.06 KB

nodejs-aws-cart-api

Installation

npm install

Running the app

# development
npm run start

# watch mode
npm run start:dev

# production mode
npm run start:prod

Test

# unit tests
npm run test

# e2e tests
npm run test:e2e

# test coverage
npm run test:cov

Create user and get auth token

register user with POST http://localhost:4000/api/auth/register

Body:

{
  "name": "your_github_login",
  "password": "TEST_PASSWORD"
}

get token with POST http://localhost:4000/api/auth/login

Body

{
  "username": "your_github_login",
  "password": "TEST_PASSWORD"
}

Response

{
  "token_type": "Basic",
  "access_token": "eW91ckdpdGh1YkxvZ2luOlRFU1RfUEFTU1dPUkQ="
}

Or you can do it with bash script, make sure you have installed curl in your system

Put content of env.example to .env and update credentials:

cat env.example > .env

Create user and get token

./get-token.sh

if command failed make script executable

chmod +x ./get-token.sh