4.9 跨域cors-博客后端Api-NodeJs+Express+Mysql实战

跨域cors
https://github.com/expressjs/...
var config = {
    cors: { //跨域请求
        origin: ['http://localhost:5000', 'http://localhost:5001'],//也可使用"*"表明容许全部
    },
}

clipboard.png

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

相关文章
相关标签/搜索