Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hapi-cors-headers

gr2m43kMIT1.0.3

hapi extension to enable CORS

hapi, cors, extension

readme

hapi-cors-headers

hapi extension to enable CORS

Build Status Coverage Status Greenkeeper badge

Enables CORS on all server response, securely from all origins, with access-control-allow-credentials: true.

Example

var Hapi = require('hapi')
var corsHeaders = require('hapi-cors-headers')

var server = new Hapi.Server()
// setup routes etc ...

server.ext('onPreResponse', corsHeaders)

Install

npm install --save hapi-cors-headers

Test

devDependency Status

npm test

License

MIT