cors-gate:在服务器端执行CORS

时间:2021-04-29 21:04:31
【文件属性】:
文件名称:cors-gate:在服务器端执行CORS
文件大小:33KB
文件格式:ZIP
更新时间:2021-04-29 21:04:31
cors connect origin corgi-tag JavaScript 科斯·盖特 连接兼容的中间件,可根据CORS规则有选择地拒绝请求。 如果只需要支持现代浏览器,则可以使用它替代CSRF令牌。 有关更多信息,请参见。 安装 在您的项目中运行此命令: $ npm install cors-gate 测试 $ npm test 用法 const express = require ( 'express' ) ; const cors = require ( 'cors' ) ; const corsGate = require ( 'cors-gate' ) ; const app = express ( ) ; app . use ( cors ( { origin : [ 'https://app.mixmax.com' , 'https://other-app.mixmax.com' ] , credentials : true } ) )
【文件预览】:
cors-gate-master
----.gitignore(609B)
----README.md(4KB)
----CHANGELOG.md(259B)
----.github()
--------pull_request_template.md(563B)
----Jenkinsfile(303B)
----test()
--------cors-gate.spec.js(7KB)
--------.eslintrc.json(35B)
----.prettierrc(28B)
----LICENSE(1KB)
----.jshintrc(386B)
----package.json(808B)
----index.js(5KB)
----cors-gate.sublime-project(403B)
----index.d.ts(265B)
----.eslintrc.json(52B)
----package-lock.json(87KB)

网友评论