Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.01 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.01 KB

service-node-koa

Backend part of redline finance

Requirements

  • node 18+
  • docker 20+

How to run

npm install
npm run dev

How to test

npm install
npm run test:service:coverage

Docker image build and run

docker build -f infrastructure/Dockerfile -t sombriks/redline-api:testing .

You can change the postgres database url for proper test values:

docker run --rm -it -p 3000:3000 --network=host \
-e PG_CONNECTION_URL=postgresql://postgres:postgres@localhost/redline \
sombriks/redline-api:testing

If you don't have a suitable postgres installation, there is a docker compose just for that:

docker compose -f infrastructure/test-database-docker-compose.yml up

Database migrations

There are npm scripts to help on database migration:

npm run migrate:make new_script # give a proper name for the migrate
npm run migrate:latest # apply all pending migrates
npm run migrate:rollback # undo latest applied migrate batch