app.all('/api/*', function(req, res, next) {
var allows = ["http://openks.oschina.io", "http://www.zhuyangxing.cn"];
if (process.env.SERVER_SOFTWARE != undefined && process.env.SERVER_SOFTWARE.indexOf("bae") > -1) {
if (allows.indexOf(req.headers.origin) > -1) {
res.header("Access-Control-Allow-Origin", req.headers.origin);
}
} else {
res.header("Access-Control-Allow-Origin", "http://10.10.11.222");
}
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
res.header("Content-Type", "application/json;charset=utf-8");
next();
});