Skip to content

paul-pop/node-express-service

Repository files navigation

Node Express Service

CircleCI codecov Codacy Badge

This is a skeleton service that uses NodeJS 8 and Express. It contains the following:

  • NPM/Yarn for dependency management
  • Jest for testing + coverage (must be > 80%)
  • Supertest for testing the express server
  • JSON configs for multi-environment setup
  • EditorConfig for code formatting
  • Swagger for API docs
  • Pino for server logging and HTTP logs
  • Dockerfile and Docker Compose to run the service

Prerequisites

In order to build the project, you will have to install the following:

Build

Yarn

yarn install

Docker

docker build -t quay.io/paulpop/node-express-service .

Run

Yarn

Development:

yarn serve

Production:

yarn forever

Docker

Environment variables:

  • ENVIRONMENT = Spring Profile to use for configurations default, dev or prod (required)
docker-compose up --build

If you need to change any of the environment variables, please use the .env file.

Linting

To run ESLint, execute:

yarn lint

Testing

To run the unit and integration tests, execute:

yarn test

Documentation

Once you run the application, the documentation of the API can be found at: http://localhost:8080/swagger

About

NodeJS Skeleton for services built with Express.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published