The following is a Node.js API using Express.js that implements the address-book project.
There are 3 different environments (production, development, and test). In order to execute the API in one of them, use the following commands:
-
Production mode:
npm start -
Development mode:
npm run dev -
Run the Test suite:
In order to run the test, use docker-compose to use a Postgres database with the commandnpm run mount
then runnpm testornpm run test:coverage. Finally runnpm run unmountto stop docker-compose.
The API manage the following structure:
TestProject
βββ package.json
βββ src
βΒ Β βββ app.js
βΒ Β βββ bin
βΒ Β βββ configuration
βΒ Β βΒ Β βββ env
βΒ Β βΒ Β βββ migrations
βΒ Β βΒ Β βββ seeders
βΒ Β βββ controllers
βΒ Β βββ middlewares
βΒ Β βββ models
βΒ Β βββ routes
βΒ Β βββ utils
βββ tests
βββ integration
βββ unit
βββ utils
API Swagger Documentation is available here
All changes are welcome. If you run into any bugs, please file an issue and explain it.