https://github.com/vithalreddy/blogs-microservice
Blog Microservice Using Express, Sequelize, Docker, Docker Compose, Postgres, Nginx
https://github.com/vithalreddy/blogs-microservice
expressjs microservice microservices-architecture nginx nodejs postgresql travis-ci
Last synced: 3 months ago
JSON representation
Blog Microservice Using Express, Sequelize, Docker, Docker Compose, Postgres, Nginx
- Host: GitHub
- URL: https://github.com/vithalreddy/blogs-microservice
- Owner: vithalreddy
- Created: 2019-01-21T18:12:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T04:53:11.000Z (over 3 years ago)
- Last Synced: 2025-03-20T03:59:48.704Z (over 1 year ago)
- Topics: expressjs, microservice, microservices-architecture, nginx, nodejs, postgresql, travis-ci
- Language: JavaScript
- Homepage:
- Size: 1.96 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 33
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# NodeJS RESTful API Microservice Example For Blog
[](https://travis-ci.org/vithalreddy/blogs-microservice)
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
- [NodeJS](https://nodejs.org/en/download "NodeJS")
- [Postgresql](https://www.postgresql.org/download "Postgresql")
## Build for local development
You have to use the following command to start a development server:
```sh
npm install
npm run dev
```
See `package.json` for more details.
## Build for production environments
```sh
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:
```sh
npm test
```
Use following command to run tests coverage in each micorservice directories:
```sh
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
```sh
npm run docs
```
## Docker Compose
Use following command to setup microserives and deploy:
```sh
docker-compose up -d --build
```
See `Dockerfile` in Microservice directories and `docker-compose.yml` for more details.