hapi-info
hapi-info
is a plugin to display information about the hapi server and the
plugins it's running.
Usage
var HapiInfo = ;var Hapi = ;var server = ;server;server;
Options
The following options are available:
path
: The route path where the information is available. Default:/hapi-info
. Setting path tonull
means a route is not created but the server function is still exposed.pluginFilter
: A RegExp used to filter out plugins from the returned information.options
: boolean. default: false. when turned on, the options passed to the plugin will also be displayed
Output example
server:node: 'v6.14.3'hapi: '16.7.0'info:created: 1545253617087started: 0host: 'sanji.local'port: 0protocol: 'http'id: 'sanji.local:17557:jpvo3ttr'uri: 'http://sanji.local'uptime: 2501memoryUsage:rss: 68087808heapTotal: 59801600heapUsed: 29752280external: 41684cpuUsage:user: 1489450system: 186843plugins:name: 'hapi-info'version: '2.0.6'name: 'blah'version: '1.2.3'name: 'main'version: '0.1.1'
server.plugins['hapi-info'].info()
The function server.plugins['hapi-info'].info()
is also exposed and
contains the same information as the endpoint as an object as opposed to json
output.