Skip to content
This repository has been archived by the owner on Apr 26, 2019. It is now read-only.

gr2m/hapi-cors-headers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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