1.0.3 • Published 5 years ago

koa-health-probe v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

koa-health-probe

Health probe for Koa that uses http://github.com/katlimruiz/koa-last-request to provide a bit meaningful info

Usage

const Koa = require('koa');
const KoaRouter = require('koa-router');
const setupKoaHealthProbe = require('koa-health-probe');

// create koa app
var app = new Koa();
var router = new KoaRouter();

// setup the probe
setupKoaHealthProbe(router, youroptions);

// setup routes on the app
app.use(router.routes()).use(router.allowedMethods());

Options

var options = {
    // route path to use, default is /tools/probe
    path: string,
    // function to customize the object returned for every probe tryout
    onRequest: function
}

Optional dependency on http://github.com/katlimruiz/koa-last-request

The package koa-last-request is used to provide the last timestamp the koa app has processed something (you can configure it to ignore certain paths, for example, this probe :)). If the package is not present, then the timestamp is not generated.

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago