Setup a NodeJS application with REST API, NoSQL Database, WebSocket and code quality tools.
expressis used as main web framework
- a lot of middlewares are also used (see
src/config/express.js)
nodemonis used to restart server everytime a file changed and save a lot of timegulpis used as task runnermochais used as test runner with :chaifor expectsupertestfor requestsinonfor stubbingnockfor simulating http callsistanbulfor code coverage
mongodbis used as database
mongooseas ORM
socket.iois used as websocketeslintis used as linter
install dependencies
$ npm install
run dev mode
$ npm run dev
Serve public folder to the root path GET http://localhost:3001/
Get all modules GET http://localhost:3001/modules
Get alive module GET http://localhost:3001/alive
Run tests
$ npm test
Run coverage.
HTML reports are available in the target folder.
$ npm run coverage
Run production mode
$ npm install --production
$ npm start
Run continuous integration command to get project health.
It will check :
- lint status
- tests status
- coverage status
Xml reports are available in the target folder.
$ npm run ci
The .editorconfig file helps you to write code with same indent syle (space FTW), encoding and line ending format for every developer.
The .eslintrc file helps you to define coding rules.