Commit 25fdc784 authored by 张烨's avatar 张烨

feat: 添加代理

parent d1aad8f2
......@@ -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}`,
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