generator-hapi-nack
所属分类:微服务
开发工具:JavaScript
文件大小:102KB
下载次数:0
上传日期:2019-10-21 15:54:35
上 传 者:
sh-1993
说明: hapijs微服务发生器
(hapijs micro-service generator)
文件列表:
.editorconfig (171, 2016-10-16)
.travis.yml (34, 2016-10-16)
LICENSE (1139, 2016-10-16)
generators (0, 2016-10-16)
generators\app (0, 2016-10-16)
generators\app\index.js (2578, 2016-10-16)
generators\app\templates (0, 2016-10-16)
generators\app\templates\_Dockerfile (206, 2016-10-16)
generators\app\templates\_deploy.sh (314, 2016-10-16)
generators\app\templates\_package.json (1364, 2016-10-16)
generators\app\templates\_server.js (901, 2016-10-16)
generators\app\templates\dockerignore (36, 2016-10-16)
generators\app\templates\gitignore (591, 2016-10-16)
generators\app\templates\lib (0, 2016-10-16)
generators\app\templates\lib\_loadPlugins.js (1788, 2016-10-16)
generators\app\templates\lib\foo.js (58, 2016-10-16)
generators\app\templates\test (0, 2016-10-16)
generators\app\templates\test\foo.test.js (256, 2016-10-16)
generators\app\templates\travis.yml (46, 2016-10-16)
package.json (1044, 2016-10-16)
screenshot.png (101513, 2016-10-16)
test (0, 2016-10-16)
test\app.js (735, 2016-10-16)
# generator-hapi-nack [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
> Hapi (hapijs) micro-service generator
![](https://github.com/nackjicholson/generator-hapi-nack/blob/master/screenshot.png)
## Installation
First, install [Yeoman](https://github.com/nackjicholson/generator-hapi-nack/blob/master/http://yeoman.io) and generator-hapi-nack.
```bash
npm install -g yo
npm install -g generator-hapi-nack
```
Then generate your new project:
```bash
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](https://github.com/nackjicholson/generator-hapi-nack/blob/master/https://github.com/sindresorhus/xo)
`$ 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](https://github.com/nackjicholson/generator-hapi-nack/blob/master/https://github.com/nackjicholson)
[npm-image]: https://badge.fury.io/js/generator-hapi-nack.svg
[npm-url]: https://npmjs.org/package/generator-hapi-nack
[travis-image]: https://travis-ci.org/nackjicholson/generator-hapi-nack.svg?branch=master
[travis-url]: https://travis-ci.org/nackjicholson/generator-hapi-nack
[daviddm-image]: https://david-dm.org/nackjicholson/generator-hapi-nack.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/nackjicholson/generator-hapi-nack
近期下载者:
相关文件:
收藏者: