📜  允许跨源节点 - Javascript 代码示例

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

代码示例1
app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});