hapi-ding
v1.0.0
Published
Informational status page for Hapi apps
Downloads
402
Readme
Ding Route Plugin for Hapi
This Hapi plugin exposes a route at /ding (by default), which responds with useful server information.
This plugin works with Hapi 17 and above.
const Hapi = require('hapi');
const server = Hapi.Server({
load: {
sampleInterval: 1000
},
host: 'localhost',
port: 8000
});
await server.register({
plugin: require('hapi-ding')
});
when you hit /ding
, the route will reply with
{
"ding": {
"cpu": [
1.67236328125,
1.828125,
1.927734375
],
"mem": 1429590016,
"time": 1425933629427,
"heap": 13402416,
"loop": 4.86166600137949
}
}
Plugin Options
The following options are available when registering the plugin:
- 'path' - the path where the route will be registered. Default is /ding.
- 'objectName' - the name of the object returned. Can be a string or
false
to put the properties at the root level. Defaults to "ding". - 'config' - optional Hapi route options to be merged with the defaults. Defaults to
{ auth: false }
. - 'otherData' - static object to be merged with the info object. Defaults to
null
.