Skip to content

Latest commit

 

History

History
78 lines (64 loc) · 1.17 KB

README.md

File metadata and controls

78 lines (64 loc) · 1.17 KB

nodejs-aws-cart-api

installation

npm i && (cd cdk && npm i)

create .env file and put there vars from env.example file. Replace values as needed

apply migrations to the database

npm run knex:migrate:latest

build and deploy

npm run build && (cd cdk && cdk synth && cdk deploy)

To create user and get basic auth token via cli run

./get-token.sh

Migrations

generate empty migration

npm run knex:migrate:make your-new-migration-name 

run migrations

npm run knex:migrate:latest

generate empty seed migration

npm run knex:seed:make

run seed migrations

npm run knex:seed:run

Tests

Before running test run postgres in docker container

docker compose up -d

Unit tests

npm run test

E2E test

npm run test:e2e

Test deploy locally with AWS SAM

  1. Install AWS SAM
  2. create .env file and put there vars from env.example file. Replace values as needed
  3. install dependencies with command
npm i && (cd cdk && npm i)
  1. Run database in docker
docker compose up -d
  1. Apply migrations
npm run knex:migrate:latest