49-跨域cors博客后端ApiNodeJsExpressMysql实战

6次阅读

共计 164 个字符,预计需要花费 1 分钟才能阅读完成。

跨域 cors
https://github.com/expressjs/…

var config = {
    cors: { // 跨域请求
        origin: ['http://localhost:5000', 'http://localhost:5001'],// 也可以使用 "*" 代表允许所有
    },
}

此时咱们启动服务,在接口调用时就会有跨域白名单拦截校验

正文完
 0