Package Exports
- hapi-view-context
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hapi-view-context) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hapi-view-context
Loads data into view context
Installation
npm install hapi-view-context
Usage
server.register({
register: require('hapi-view-context'),
options: {
'someVariable': 'Some Value',
'some.nested.variable': 'Another value'
}
});
Options are used to set the default context. The object key will match the context path.
server.ext('onPreResponse', function(request, reply) {
server.plugins['hapi-view-context'].addContext('amazingData', 'More data');
});