Socket
Socket
Sign inDemoInstall

micro-cors

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-cors - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

src/index.js

41

package.json
{
"name": "micro-cors",
"description": "Simple CORS middleware for Zeit's Micro",
"version": "0.0.1",
"version": "0.0.2",
"engines": {

@@ -15,13 +15,36 @@ "node": ">=6"

"scripts": {
"test": "ava --fail-fast --verbose",
"test:watch": "npm test -- --watch"
"build": "rimraf lib && babel src --out-dir lib",
"test": "ava --verbose src/test.js",
"dev": "ava --verbose --watch src/test.js"
},
"main": "lib/index.js",
"dependencies": {
"request": "^2.81.0",
"request-promise": "^4.2.0"
},
"devDependencies": {
"async-to-gen": "1.3.0",
"ava": "0.17.0",
"babel-polyfill": "6.20.0",
"micro": "6.1.0",
"request-promise": "4.1.1",
"test-listen": "1.0.0"
"async-to-gen": "^1.3.2",
"ava": "^0.18.2",
"babel-cli": "^6.24.0",
"babel-polyfill": "^6.23.0",
"babel-preset-latest": "^6.24.0",
"babel-preset-stage-0": "^6.22.0",
"babel-register": "^6.24.0",
"micro": "^7.3.0",
"rimraf": "^2.6.1",
"test-listen": "^1.0.1"
},
"ava": {
"failFast": true,
"require": [
"babel-register"
],
"babel": "inherit"
},
"babel": {
"presets": [
"latest",
"stage-0"
]
}
}

@@ -9,2 +9,8 @@ # CORS middleware for Micro

### Install
```
yarn add micro-api
```
### Usage

@@ -14,5 +20,6 @@

```
const cors = require('micro-cors')
```js
const cors = require('micro-cors')()
const handler = (req, res) => send(res, 200, 'ok!')
module.exports = cors((req, res) => send(res, 200, 'ok!'))

@@ -23,6 +30,7 @@ ```

```
```js
const microCors = require('micro-cors')
const cors = microCors({ allowMethods: ['PUT', 'POST'] })
const handler = (req, res) => send(res, 200, 'ok!')
module.exports = cors(handler)

@@ -29,0 +37,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc