README
Introduction
This package supports checking service whether alive or not.
Capabilities and Frameworks
Capability | Module |
---|---|
Server Framework | hapi as a web server |
API documentation | hapi-swagger support self documentation the API interface in the project from code annotations. hapi-swagger will need to install the inert static file and directory handlers plugin for hapi.js, vision templates rendering support for hapi.js |
Coding Standard | eslint identifying and reporting on patterns found in ECMAScript/JavaScript code completely pluggable, babel-eslint support parsing ECMAScript for eslint |
Testing Framework | chai a BDD / TDD assertion library for node and browser, mocha test framework, nyc command line interface support checking code coverage |
How to test
npm test
npm test:coverage
How to check lint
npm run lint
npm run lintFix
How to use
dependencies
in package.json
Install this module check "dependencies": {
"@askbills/healthcheck": "0.0.1"
}
api
tag.
Create a service connection object with an server.connection([
{
address: 'localhost',
port: 3000,
labels: ['api']
}
]);
healthcheck
, check dependencies
Add it as an object in plugins array with register const pkg = require('../package.json');
const plugins = [
inert,
vision,
{
select: ['api'],
register: hapiSwagger
},
{
select: ['api'],
register: healthcheck,
options: {
pkg: pkg.dependencies,
config: {
api: {
version: '0.0.0'
}
}
}
}
];
server.register(plugins);