Getting express server to accept CORS request

前端 未结 6 698
陌清茗
陌清茗 2020-12-06 09:42

I have my express server running on http://localhost:3000 (I call this web-server) I have another application running on localhost:8100 (I call this simply \'app\')

6条回答
  •  遥遥无期
    2020-12-06 10:17

    I use cors and implement it so, it's very simple

    var cors=require('cors');

    app.use(cors({origin:true,credentials: true}));

提交回复
热议问题