Skip to content

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

Notifications You must be signed in to change notification settings

aptoma/hapi-static-headers

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published