2.1.0 • Published 8 years ago

generator-hapi-nack v2.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

generator-hapi-nack NPM version Build Status Dependency Status

Hapi (hapijs) micro-service generator

npm.io

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 and good-console process reporting
  • hapi-swaggered and hapi-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