Package Exports
- hapi-cors-headers
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-cors-headers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hapi-cors-headers
hapi extension to enable CORS
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
npm test