First of all, create the .env file (you have the example of the .env.example file).
After starting the docker services, be sure to install the dependencies and if you want, you can run the migration to have the database structure and two registered users.
make upor
docker-compose up -dThis will start the Node and PostgreSQL docker services.
If have error be sure that your local services (like postgreSQL) are stopped.
make downor
docker-compose downmake run-devor
docker-compose exec api npm run devThis will run nodemon with typescript in dev environment.
make run-startor
docker-compose exec api npm run startThis will compile typescript in ./dist folder and run nodemon with js transpiled.
make run-buildor
docker-compose exec api npm run buildThis will only compile the typscript
make installor
docker-compose exec api npm installmake eslint-check
make eslint-fixor
docker-compose exec api npm run eslint:check
docker-compose exec api npm run eslint:fixRules for eslint are in .eslintrc.json file on root path.
make run-test-unitor
docker-compose exec api npm run test:unitmake run-test-unit-coverageor
docker-compose exec api npm run test:unit:coveragemake migrate-backoffice-runor
docker-compose exec api npm run migrate:backoffice:runmake migrate-backoffice-revertor
docker-compose exec api npm run migrate:backoffice:revertdocker-compose exec api npx db-migrate create {name_of_migration}Method:
GET
[
{
"id": "32547dd7-617a-4985-a59a-91a176e55b83",
"name": "Iván"
},
{
"id": "43ba0b24-4d0b-40f7-aa7f-1b2a3058f484",
"name": "Nabby"
}
]Method:
GET
URL: http://localhost:8080/backoffice/users/32547dd7-617a-4985-a59a-91a176e55b83
{
"id": "32547dd7-617a-4985-a59a-91a176e55b83",
"name": "Iván"
}Method:
POST
Body:
{
"name": "Iván"
}No response
Method:
PUT
URL: http://localhost:8080/backoffice/users/32547dd7-617a-4985-a59a-91a176e55b83
Body:
{
"id": "32547dd7-617a-4985-a59a-91a176e55b83",
"name": "Other"
}No response
Method:
DELETE
URL: http://localhost:8080/backoffice/users/32547dd7-617a-4985-a59a-91a176e55b83
No response