Comparing version
{ | ||
"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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
128196
1597.06%7
16.67%53
17.78%2
Infinity%10
66.67%214
-0.47%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added