Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sugarshin/micro-cors-multiple-allow-origin
Add multiple allowed origin for ZEIT's Micro
https://github.com/sugarshin/micro-cors-multiple-allow-origin
cors micro zeit
Last synced: 22 days ago
JSON representation
Add multiple allowed origin for ZEIT's Micro
- Host: GitHub
- URL: https://github.com/sugarshin/micro-cors-multiple-allow-origin
- Owner: sugarshin
- Created: 2018-08-06T12:48:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-08T02:07:28.000Z (over 6 years ago)
- Last Synced: 2024-11-13T15:24:18.879Z (about 2 months ago)
- Topics: cors, micro, zeit
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/micro-cors-multiple-allow-origin
- Size: 41 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# micro-cors-multiple-allow-origin
[![CircleCI](https://circleci.com/gh/sugarshin/micro-cors-multiple-allow-origin.svg?style=svg&circle-token=6df98fe810b3c5fc49bf7c37b1f42da9cfdcda81)](https://circleci.com/gh/sugarshin/micro-cors-multiple-allow-origin)
CORS for ZEIT's [Micro](https://github.com/zeit/micro).
Add multiple allowed origin.
```bash
yarn add micro-cors-multiple-allow-origin
```## Usage
```js
const corsMultipleAllowOrigin = require('micro-cors-multiple-allow-origin')
const cors = corsMultipleAllowOrigin({ origin: ['https://github.com', 'https://sugarshin.net'] })
const handler = (req, res) => send(res, 200, 'ok!')
module.exports = cors(handler)
```### Options
Other options refer to https://github.com/possibilities/micro-cors#options
## License
[MIT][license-url]
© sugarshin
[license-image]: https://img.shields.io/:license-mit-blue.svg?style=flat-square
[license-url]: https://sugarshin.mit-license.org/