continuationlabs / hapi-setup

hapi plugin for viewing the server configuration
8 stars 6 forks source link

hapi-setup

Current Version Build Status via Travis CI Dependencies belly-button-style

hapi plugin that exposes a setup method for retrieving the server configuration. Provides information such as the version of Node running, the hapi server connections, routing tables per connection, and plugin information.

Example Usage

The example below registers the hapi-setup plugin. In the handler for the /about route, the hapi-setup.setup() function is executed, which returns an object, and the result is then used to reply to the incoming request.

var server = new Hapi.Server();
server.connection();

server.register(require('hapi-setup'), function (err) {
  server.route({
    method: 'GET',
    path: '/about',
    handler: function (request, reply) {
      reply(request.server.plugins['hapi-setup'].setup());
    }
  })
});

API

setup()

Exposed plugin method used for returning the setup information of the current hapi server.

Returns the following object: