Setup a NodeJS application with REST API, NoSQL Database, WebSocket and code quality tools.
express
is used as main web framework
- a lot of middlewares are also used (see
src/config/express.js
)
nodemon
is used to restart server everytime a file changed and save a lot of timegulp
is used as task runnermocha
is used as test runner with :chai
for expectsupertest
for requestsinon
for stubbingnock
for simulating http callsistanbul
for code coverage
mongodb
is used as database
mongoose
as ORM
socket.io
is used as websocketeslint
is 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.