ot-hapi-health

Health plugin for Hapi

Usage no npm install needed!

<script type="module">
  import otHapiHealth from 'https://cdn.skypack.dev/ot-hapi-health';
</script>

README

ot-hapi-health

Health plugin for Hapi

Build Status Dependency Status NPM version

NPM

Overview

Defines /health endpoint:

GET /health
Host: yourhost.com

HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
cache-control: no-cache

☃

Usage

$ 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();
});

Release History

  • v1.0.1 (2016-11-18)
    • added optional isHealthy validator to establish app readiness
  • v1.0.0 (2015-08-03)
    • initial release