hapi-response-meta
Adds meta to hapi response
Last updated 5 years ago by developmentseed .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hapi-response-meta 
SYNC missed versions from official npm registry.

hapi-response-meta

npm version Build Status

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

Current Tags

  • 0.3.0                                ...           latest (5 years ago)

3 Versions

  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |