hapi plugin utilities and endpoints
furball provides a basic set of endpoints for hapi-based servers. Once registered, the plugin adds two endpoints:
- /version - the version number of the current root module.
- /plugins - a list of the plugins loaded in the server with their versions.
The main purpose of furball is to provide a template for writing other hapi plugins.
Both endpoints can be disabled or the path customized:
var options = {
plugin: {
version: { path: '/VERSION' },
plugins: false
}
};
var server = new Hapi.Server();
server.plugin().register('furball', options, function (err) { });
The module also registers the 'plugins()' API method:
console.log(server.plugins.furball.plugins(server));