| | |
| | | const proxy = require('http-proxy-middleware') |
| | | const host = 'http://bms-test.kresstools.cn' |
| | | const service = 'oc/' |
| | | const options = require('../public/options.json') |
| | | |
| | | module.exports = function(app) { |
| | | app.use(proxy('/webapi', { |
| | | target: `${host}/${service}webapi`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/webapi': '/' |
| | | } |
| | | // cookieDomainRewrite: "http://localhost:3000" |
| | | })) |
| | | // app.use(proxy('/webapi', { |
| | | // target: `${host}/${service}webapi`, |
| | | // secure: false, |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '^/webapi': '/' |
| | | // } |
| | | // // cookieDomainRewrite: "http://localhost:3000" |
| | | // })) |
| | | |
| | | app.use(proxy('/zh-CN', { // 登录接口 |
| | | target: `${host}/${service}zh-CN`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/zh-CN': '/' |
| | | } |
| | | })) |
| | | // app.use(proxy('/zh-CN', { // 登录接口 |
| | | // target: `${host}/${service}zh-CN`, |
| | | // secure: false, |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '^/zh-CN': '/' |
| | | // } |
| | | // })) |
| | | |
| | | app.use(proxy('/Upload', { |
| | | target: `${host}/${service}zh-CN/Home/Upload`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/Upload': '/' |
| | | } |
| | | })) |
| | | // app.use(proxy('/Upload', { |
| | | // target: `${host}/${service}zh-CN/Home/Upload`, |
| | | // secure: false, |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '^/Upload': '/' |
| | | // } |
| | | // })) |
| | | |
| | | app.use(proxy('/wxpay', { |
| | | target: `${host}/${service}wxpay`, |
| | | target: `${options.host}/${options.service}`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/wxpay': '/' |
| | | } |
| | | changeOrigin: true |
| | | })) |
| | | |
| | | app.use(proxy('/Home', { |
| | | target: `${host}/Home`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/Home': '/' |
| | | } |
| | | // cookieDomainRewrite: "http://localhost:3000" |
| | | })) |
| | | // app.use(proxy('/trans', { |
| | | // target: `${host}/${service}`, |
| | | // secure: false, |
| | | // changeOrigin: true |
| | | // })) |
| | | |
| | | app.use(proxy('/trans', { |
| | | target: `${host}/${service}trans`, |
| | | // app.use(proxy('/api', { // 旷视面板机接口测试 |
| | | // target: `http://192.168.1.66:80`, |
| | | // secure: false, |
| | | // changeOrigin: true |
| | | // })) |
| | | |
| | | app.use(proxy('/star', { |
| | | target: `http://dms.worx.cn/webapi`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/trans': '/' |
| | | } |
| | | changeOrigin: true |
| | | })) |
| | | } |
| | | } |