generator-hapi-nack
Hapi (hapijs) micro-service generator
Installation
First, install Yeoman and generator-hapi-nack.
npm install -g yo
npm install -g generator-hapi-nack
Then generate your new project:
cd my-project
yo hapi-nack
Features
Working hapijs Server
By default comes setup with the following plugins:
good
andgood-console
process reportinghapi-swaggered
andhapi-swaggered-ui
automatic documentation generator.hapi-pkg
provides a "/healthcheck" route.
Also provides a sample route "/foobar" which returns a JSON response {"foo": "bar"}
.
NPM Scripts
Linting with Eslint
Configured by default to use the "xo-space" learn more here
$ npm run lint
Will lint your code anytime a file changes in the lib
and test
directory.
Tests with mocha
$ npm test
Runs a test of your code using mocha. Tests can be written using es2015 as well.
$ npm run cov
Produces an istanbul coverage report in the coverage/
directory.
Dev Mode
$ npm run tdd
Run a file watcher to run the tests anytime a file in lib
or test
is changed.
$ npm run tdd:lint
Run a file watcher which performs linting, code style checks, and tests anytime you save a file.
Start the server
$ npm start
$ npm run start:dev
License
MIT © Will Vaughn