const proxy = require('http-proxy-middleware') const host = 'http://qingqiumarket.cn' const service = 'mkwms/' // const host = 'http://cloud.mk9h.cn' // const service = '' 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('/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('/local', { target: 'http://127.0.0.1:8888', secure: false, changeOrigin: true, pathRewrite: { '^/local': '/' } })) }