📌  相关文章
📜  从源 HTTP localhost:3000 访问 XMLHttpRequest 已被 CORS 策略阻止 - Javascript 代码示例

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

代码示例1
const cors = require('cors');
const corsOptions ={
    origin:'http://localhost:3000', 
    credentials:true,            //access-control-allow-credentials:true
    optionSuccessStatus:200
}
app.use(cors(corsOptions));