Comparing version 0.0.1 to 0.0.2
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128196
7
53
2
10
214
1
+ Addedrequest@^2.81.0
+ Addedrequest-promise@^4.2.0
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.9.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequest-promise@4.2.6(transitive)
+ Addedrequest-promise-core@1.1.4(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstealthy-require@1.1.1(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)