Access-Control-Allow-Origin Error..(using cordova)

后端 未结 4 1045
刺人心
刺人心 2021-01-28 10:30

I\'m trying to web server and client..(Hybrid app! using cordova) But Access-Control-Allow-Origin error..so I downloaded chrome extension program cors.. but doesn\'t working..

4条回答
  •  后悔当初
    2021-01-28 11:02

        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();
    });
    

    You can use like this also , may be it will help.

提交回复
热议问题