📌  相关文章
📜  Access-Control-Allow-Origin 不允许来源 http: localhost:3002. - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:14.611000             🧑  作者: Mango

代码示例3
var allowCrossDomain = function(req, res, next) {
    res.header('Access-Control-Allow-Origin', "*");
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');
    next();
}