vinicinbgs / addressbook-ts-node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐳 Using Docker

To better understand about the ports that the services are running, check in: docker-compose.yml

npm run config:env
docker-compose up -d --build
docker-compose exec api npm run typeorm:migration:run

API: http://localhost:3000/api/v1/healthcheck
Swagger: http://localhost:3000/api/v1/docs
Report Coverage: http://localhost:3000/report-coverage

To access db-admin, enter in browser: http://localhost:8080
user: root
password: root
database: address-book


📦 Run in Development mode

First thing if you are running the API container on docker, use:

docker-compose stop api

because will conflict the ports.

Run only if you do not have .env file yet, otherwise will overwrite the current.

npm run config:env

Change TYPEORM_HOST="db" to TYPEORM_HOST="localhost" in .env

npm run typeorm:migration:run
npm run dev

🧪 Run unit tests

npm run test <---- Only run the test
npm run test:coverage  <----- Run test generating coverage text and html
npm run test:coverage:text <---- Run test generating only coverage text

About


Languages

Language:TypeScript 94.0%Language:Shell 5.0%Language:Dockerfile 1.0%Language:Procfile 0.1%