Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请求报跨域问题 'Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.' #42

Closed
my9074 opened this issue Feb 13, 2017 · 2 comments

Comments

@my9074
Copy link

my9074 commented Feb 13, 2017

接口配置如图:
2017-02-13 16 31 50

设置完接口后,用nei server 起 nodejs 本地接口服务,用 Chrome/Firefox 浏览器发送 PUT 请求,只有 OPTION 方法 没有发送 PUT 请求。console 报跨域的问题。建议直接在 apiResHeaders 下配置允许跨域的那几个标记

2017-02-13 16 37 19

2017-02-13 16 32 01

@my9074 my9074 changed the title PUT 请求报跨域问题 'Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.' 请求报跨域问题 'Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.' Feb 13, 2017
@AbnerZheng
Copy link
Contributor

你好, 在运行好nei后,会生成一个nei.{key}的文件夹,里面有server.config.js, 其中的apiResHeaders设置为跨域的标识即可

@my9074
Copy link
Author

my9074 commented Feb 14, 2017

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants