Commit acdb096d authored by 张烨's avatar 张烨

feat: update proxy match regexp

parent 5d43ab8c
......@@ -64,13 +64,13 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
const proxy2 = process.env.PROXY2;
if (proxy2) {
const reg = /(\w+)\s+:\s+([\w:./]+)/;
const reg = /([/\w]+)\s*:\s*([\w:./]*)/;
const match = proxy2.match(reg);
const [, pre, host] = match;
logger.info(`using proxy2 at: ${host}`);
logger.info(`proxy2 prefix: ${pre}`);
app.use(
`/${pre}`,
`${pre.indexOf(0) === '/' ? pre : `/${pre}`}`,
createProxyMiddleware({
target: host,
changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment