main.js 409 Bytes
const Express = require('express');
let router = Express.Router(); // eslint-disable-line
const request = require('request');
const env = global.env;

let mainProxy = (req, res) => {
    res.header('x-version', env.version);
    request.get(`http://cdn.yoho.cn/yoho-shop-manage/${env.version}/index.html`).pipe(res);
};

router.get('/', mainProxy);
router.get(/\.html$/, mainProxy);

module.exports = router;