/blogs-microservice

Blog Microservice Using Express, Sequelize, Docker, Docker Compose, Postgres, Nginx

Primary LanguageJavaScript

NodeJS RESTful API Microservice Example For Blog

Build Status

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.

Requirements

Build for local development

You have to use the following command to start a development server:

npm install
npm run dev

See package.json for more details.

Build for production environments

npm install --production
npm start

See package.json for more details.

Tests

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

Docker Compose

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.