@aptoma/hapi-static-headers

Plugin for adding a defined set of headers to append to all responses.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
11Oct 4, 2019Feb 1, 2016Minified + gzip package size for @aptoma/hapi-static-headers in KB

Readme

Build Status

@aptoma/hapi-static-headers

Hapi Plugin for adding a defined set of headers to be appended to all responses.

Installation

This module is installed via npm:

$ npm install @aptoma/hapi-static-headers

Examples


    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'
            }
        }
    });

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.