Boilerplate for express web applications.
- Clustered mode, gracefull shudown or reload with PM2
- Integration and unit tests (with mocha and supertest)
- Test code coverage (istanbul and generated report
- Generated documentation site from inline comments (jsDoc)
- Auto generated swagger documentation from inline comments or from yaml files
- Auto validation of content, params and query of your swagger documented endpoints
- Asynchronous logging with multi transport support (winston) and promised logging
- Debug synchronously with diff timing between outputs and namespaced (debug)
- Additional express features for with promised api start and deferred middleware mounts
- bluebird promises
- Highly configurable and customizable with config for different enviroments
- Modular approach to api mount allowing to serve diverse apis and unit test specific routers
- node: >5.10
- npm: >3.3
npm install [--production]
Install PM2 globally to manage your
node cluster
sudo npm install -g pm2
You will need to add a local configuration file: ./config/local.yaml
that
will overwrite the configuration, check
node-config for details on how the configuration is setup.
pm2 start ecosystem.json -env <development|production>
NODE_ENV=<production|development> npm run start -s
For continuous integration with no downtime
pm2 gracefulReload app
npm run debug -s
npm run test -s
Coverage reports will be generated at ./coverage
eslint linting check
npm run lint -s
jsDoc Documentation
npm run docs -s
Documentation will be generated at ./docs
To inspect ./coverage
and ./docs
you may want to serve your local files.
You can use http-server
for that:
npm install -g http-server
http-server