hapi-response-meta
v0.3.0
Published
Adds meta to hapi response
Downloads
25
Readme
hapi-response-meta
This Hapi plugin adds metadata to a hapi response.
Installation
$: npm install hapi-response-meta
Registration
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