...
|
...
|
@@ -2,11 +2,16 @@ const Express = require('express'); |
|
|
let router = Express.Router(); // eslint-disable-line
|
|
|
const rp = require('request-promise');
|
|
|
const env = global.env;
|
|
|
const pageCache = {};
|
|
|
|
|
|
let mainProxy = (req, res) => {
|
|
|
res.header('x-version', env.version);
|
|
|
res.header('cache-control', 'no-store');
|
|
|
rp.get(`http://cdn.yoho.cn/yoho-shop-manage/${env.version}/index.html`).then(body => {
|
|
|
if (pageCache[env.version]) {
|
|
|
return res.send(pageCache[env.version]);
|
|
|
}
|
|
|
return rp.get(`http://cdn.yoho.cn/yoho-shop-manage/${env.version}/index.html`).then(body => {
|
|
|
pageCache[env.version] = body;
|
|
|
res.send(body);
|
|
|
});
|
|
|
};
|
...
|
...
|
|