Health plugin for Hapi
Defines /health
endpoint:
GET /health
Host: yourhost.com
HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
cache-control: no-cache
☃
$ npm i ot-hapi-health --save
var server = new (require('hapi').Server)();
server.connection({ port: 3000 });
server.register({
plugin: require('ot-hapi-health'),
options: {
isHealthy: cb => cb(true) // optional async validator to establish app readiness
}
}, function(err) {
if (err) {
console.error('Failed to load plugin:', err);
}
server.start();
});
- v1.0.1 (2016-11-18)
- added optional
isHealthy
validator to establish app readiness
- added optional
- v1.0.0 (2015-08-03)
- initial release