Sailsjs CORS'Access-Control-Allow-Origin'问题

时间:2018-05-30 06:04:14

标签: javascript api cors sails.js

我目前正在遇到来自sails API端点的响应的CORS原因问题。我已经在security.js文件中设置了allowRoutes: true and allowOrigin: "*"个选项,但我仍然得到了Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.我做错了什么?

1 个答案:

答案 0 :(得分:1)

Access-Control-Allow-Origin添加到config / cors.js的headers