Hapi Plugin for adding a defined set of headers to be appended to all responses.
This module is installed via npm:
$ npm install @aptoma/hapi-static-headers
const server = new Hapi.Server();
await server.register({
plugin: require('@aptoma/hapi-static-headers'),
options: {
headers: {
'X-API-Version': (request) => {
return request.pre.apiVersion;
},
'X-Service': 'The Service'
}
}
});