# whitelistcors

> CORS toolkit

Latest version **1.0.3** (published 2021-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install whitelistcors
pnpm add whitelistcors
yarn add whitelistcors
bun add whitelistcors
```

## 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 | 2021-01-15 |
| First published | 2021-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Giuseppe Zileni @gzileni giuseppe.zileni@gmail.com |
| Maintainers | giuseppe.zileni |
| Keywords | cors, nodejs |

## Links

- npm: https://www.npmjs.com/package/whitelistcors
- Repository: https://github.com/gzileni/whitelistcors
- Homepage: https://github.com/gzileni/whitelistcors.git#readme
- Issues: https://github.com/gzileni/whitelistcors.git/issues
- npm.io page: https://npm.io/package/whitelistcors

## Dependencies (3)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.20

## Recent versions

- 1.0.3 (latest) — 2021-01-15

## README

# WHITELIST
PlugIn to configure [CORS Cross-Origin Resource Sharing](https://developer.mozilla.org/it/docs/Web/HTTP/CORS)

## Installation

```
    npm install --save whitelistcors

    yarn add whitelistcors
```

## Use

To enable a resource to a specific request from an HTTP source, an array of addresses must be implemented.

```
    var whitelist = require('whitelistcors');

    var origins = ['http://localhost', 'http://mysite.com'];

    router.post('/', whitelist(origins), function(req, res, next) {

        .....
    
    });

```

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