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

Commit 49f8a39

Browse files
committed
docs(README): initial version
0 parents  commit 49f8a39

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# hapi-cors-headers
2+
3+
> hapi extension to enable CORS
4+
5+
[![NPM version](https://badge.fury.io/js/hapi-cors-headers.svg)](https://www.npmjs.com/package/hapi-cors-headers)
6+
[![Build Status](https://travis-ci.org/gr2m/hapi-cors-headers.svg?branch=master)](https://travis-ci.org/gr2m/hapi-cors-headers)
7+
[![Coverage Status](https://coveralls.io/repos/gr2m/hapi-cors-headers/badge.svg?branch=master)](https://coveralls.io/r/gr2m/hapi-cors-headers?branch=master)
8+
[![Dependency Status](https://david-dm.org/hoodiehq/pouchdb-hoodie-api.svg)](https://david-dm.org/hoodiehq/pouchdb-hoodie-api)
9+
10+
Enables [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) on
11+
all server response, securely from all origins, with `access-control-allow-credentials: true`.
12+
13+
## Example
14+
15+
```js
16+
var Hapi = require('hapi')
17+
var corsHeaders = require('hapi-cors-headers')
18+
19+
var server = new Hapi.Server()
20+
// setup routes etc ...
21+
22+
server.ext('onPreResponse', addCorsHeaders)
23+
```
24+
25+
## Install
26+
27+
```bash
28+
npm install --save hapi-cors-headers
29+
```
30+
31+
## Test
32+
33+
[![devDependency Status](https://david-dm.org/hoodiehq/pouchdb-hoodie-api/dev-status.svg)](https://david-dm.org/hoodiehq/pouchdb-hoodie-api#info=devDependencies)
34+
35+
```bash
36+
npm test
37+
```

0 commit comments

Comments
 (0)