Easy to use opinionated ExpressJS based micro-service boilerplate. This boilerplate provides a solid pattern that developers can use to scaffold and start devleop a ExpressJS (NodeJS) based microservice within seconds. The boilerplate demonstrates several key design patterns that include:
This boilerplate provides pre-configured:
Getting started with this boilerplate is easy. There are two ways to install and use it
Clone this repo on your workstation
git clone https://github.com/doomsbuster/expressjs-microservice.git YOUR_PROJ_NAME
Boilerplate is also available as module from NPM and Yarn registry.
npm install expressjs-microservice
Once you have installed the module, copy the expressjs-microservice to your project directory.
cp -R ./node_modules/expressjs-microservice/* .
Once you have installed the boilerplate, running it is easy:
Start the application using
Point your browser at
http://localhost:3000, you should see the swagger documentation for the boilerplate API.
The base API is available at the route
You can trigger unit tests that have full coverage using
istanbul and spec reporting using
jasmine-spec-reporter using the following command
All intgration tests whose names end in
-IT.js for example
it/posts-IT.js created under the
expressjs-microservice/it directory will be executed as a part of the integration test command described below.
The name of the file must match the globbing pattern
posts-it.js- Not matched
You can customize this behavior by updating the
Run your integration test using the command:
npm run integtest
This project does come with test coverage for all files as they are expected to be removed or different for your projects. Samples are for demonstration of the concept and the pattern only.
Fork the repo and submit a pull request.
Mr. Doomsbuster doesn't care about attribution. All source code is license under Do What The Fuck You Want To (WTFPL) public license.