hapi extension to enable CORS
Enables CORS on
all server response, securely from all origins, with access-control-allow-credentials: true
.
var Hapi = require('hapi')
var corsHeaders = require('hapi-cors-headers')
var server = new Hapi.Server()
// setup routes etc ...
server.ext('onPreResponse', corsHeaders)
npm install --save hapi-cors-headers
npm test