16.1.2 • Published 7 years ago

@clevyr/checkup-routes v16.1.2

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
7 years ago

Checkup Routes Hapi Plugin

Default health check routes for hapi microservices.

  • Dependency Injection compatible (and required!).
  • Flow strictly typed.
  • Includes Unit and Integration tests.
  • Exports as a Hapi Plugin Factory.

Installation

npm install

Usage

npm install --save-optional git+ssh://git@gitlab.clevyr.com:microservices/checkup-routes.git

First add the module to your DI Container.

// di.js (Or your dependency injection definition file)

// ... represents more code that isn't included here.

// Automatically registers checkModel, checkRoute, and checkupPluginRoutes with the diContainer.
const checkupRoutesPluginFactory = require('checkup-routes')(diContainer);

...

diContainer.register('checkupRoutesPlugin', checkupRoutesPluginFactory);

Then inject the plugin and register it with Hapi.

// server.js (Or your hapi server setup file)

// ... represents more code that isn't included here.

module.export = function serverFactory(...checkupRoutesPlugin...) {
  ...

  server.register([...checkupRoutesPlugin...], ...

  ...
};

module.exports.$inject = [...'checkupRoutesPlugin'...];

Tests

The tests use the ava framework.

npm test

Linters

Lint config files included at root of project:

  • .eslintrc, .eslintignore
  • .jscsrc
// ESLint
npm install -g eslint

eslint src
 - or -
npm run lint
// JSCS
npm install -g jscs
jscs src
16.1.2

7 years ago

16.1.1

7 years ago

16.1.0

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago