Example Node.js RESTful API microservice for an Blog with unit tests, code style checking and good test coverage. The microservice exposes REST APIs which are documented using Swagger.
You have to use the following command to start a development server:
npm install
npm run dev
See package.json
for more details.
npm install --production
npm start
See package.json
for more details.
Following tests libraries are used for unit/integration tests:
Tests are kept next to source with following pattern *.spec.js
Use following command to run tests in each micorservice directories:
npm test
Use following command to run tests coverage in each micorservice directories:
npm run coverage
Use following command to Generate and Open Documenation in Browser in each micorservice directories:
make sure microservice is running to test docs, interactively
npm run docs
Use following command to setup microserives and deploy:
docker-compose up -d --build
See Dockerfile
in Microservice directories and docker-compose.yml
for more details.