Commit 40df6f9f authored by 何硕's avatar 何硕

Merge branch 'heshuo' into 'master'

test

See merge request !14
parents 7fac3b36 70ec640a
...@@ -14,6 +14,19 @@ let fs = require("fs"); ...@@ -14,6 +14,19 @@ let fs = require("fs");
// res.header("Content-Type", "application/json;charset=utf-8"); // res.header("Content-Type", "application/json;charset=utf-8");
// next(); // next();
// }); // });
//allow custom header and CORS
app.all('*',function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
if (req.method == 'OPTIONS') {
res.send(200);
}
else {
next();
}
});
// var BaseUrl = "http://localhost/api/"; // var BaseUrl = "http://localhost/api/";
var BaseUrl = "https://zhibo.xueyoubangedu.com/api/"; var BaseUrl = "https://zhibo.xueyoubangedu.com/api/";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment