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 test
ornpm run test:coverage
. Finally runnpm run unmount
to 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.