0.3.0 • Published 10 years ago
hapi-response-meta v0.3.0
hapi-response-meta
This Hapi plugin adds metadata to a hapi response.
Installation
$: npm install hapi-response-metaRegistration
var Hapi = require('hapi');
var hapi = new Hapi.Server();
hapi.connection();
hapi.register({
  register: require('hapi-response-meta'),
  options: {
    key: 'meta',
    content: {
        provided_by: 'Some Organization',
        site: 'example.com'
    },
    results: 'results',
    routes: ['/', '/api'],
    excludeFormats: ['csv']
  }
};Example
curl -X GET http://www.example.com{
    "meta": {
        "provided_by": "Some Organization",
        "site": "example.com"
    },
    "results": {
        "key": "value"
    }
}Test
$ npm test