# hapi-cors-headers

> hapi extension to enable CORS

Latest version **1.0.3** (published 2017-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install hapi-cors-headers
pnpm add hapi-cors-headers
yarn add hapi-cors-headers
bun add hapi-cors-headers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-11-16 |
| First published | 2015-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Gregor Martynus |
| Maintainers | gr2m |
| Keywords | hapi, cors, extension |

## Links

- npm: https://www.npmjs.com/package/hapi-cors-headers
- Repository: https://github.com/gr2m/hapi-cors-headers
- Homepage: https://github.com/gr2m/hapi-cors-headers#readme
- Issues: https://github.com/gr2m/hapi-cors-headers/issues
- npm.io page: https://npm.io/package/hapi-cors-headers

## Recent versions

- 1.0.3 (latest) — 2017-11-16
- 1.0.2 — 2017-11-16
- 1.0.1 — 2017-11-16
- 1.0.0 — 2015-07-25

## README

# hapi-cors-headers

> hapi extension to enable CORS

[![Build Status](https://travis-ci.org/gr2m/hapi-cors-headers.svg?branch=master)](https://travis-ci.org/gr2m/hapi-cors-headers)
[![Coverage Status](https://coveralls.io/repos/gr2m/hapi-cors-headers/badge.svg?branch=master)](https://coveralls.io/r/gr2m/hapi-cors-headers?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/gr2m/hapi-cors-headers.svg)](https://greenkeeper.io/)

Enables [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) on
all server response, securely from all origins, with `access-control-allow-credentials: true`.

## Example

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

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

server.ext('onPreResponse', corsHeaders)
```

## Install

```bash
npm install --save hapi-cors-headers
```

## Test

[![devDependency Status](https://david-dm.org/gr2m/hapi-cors-headers/dev-status.svg)](https://david-dm.org/gr2m/hapi-cors-headers#info=devDependencies)

```bash
npm test
```

## License

[MIT](LICENSE.md)

---
_Source: https://npm.io/package/hapi-cors-headers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
