# simple-cors

> Simple module to add Cross-Origin Resource Sharing headers to your routes

Latest version **2.0.1** (published 2022-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-cors
pnpm add simple-cors
yarn add simple-cors
bun add simple-cors
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-04-18 |
| First published | 2014-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maurice Butler |
| Maintainers | mauricebutler |
| Keywords | CORS, cross, origin, resource, sharing, cross-origin, simple |

## Links

- npm: https://www.npmjs.com/package/simple-cors
- Repository: https://github.com/MauriceButler/simple-cors
- Issues: https://github.com/MauriceButler/simple-cors/issues
- npm.io page: https://npm.io/package/simple-cors

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-04-18
- 2.0.0 — 2020-06-05
- 1.1.1 — 2015-03-11
- 1.1.0 — 2014-06-27
- 1.0.0 — 2014-05-08

## README

# `simple-cors`

Simple module to add Cross-Origin Resource Sharing headers to your routes.

This module will add the following (very open CORS headers) to your response.

```
Access-Control-Allow-Origin: '*'
Access-Control-Allow-Methods: 'GET,PUT,POST,DELETE,OPTIONS'
Access-Control-Allow-Headers: request.headers['access-control-request-headers']
```
and will respond with `200 OK` to any `OPTIONS` request

## Install

```shell
npm install simple-cors
```

## Usage

```js
var corsRoute = require('simple-cors');

routes['/api/test'] = corsRoute(function(request, response){
    response.end('Hello CORS World!');
});
```

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