浏览代码

fix(admin-ui-plugin): proxy target template string (#3514)

Casper Iversen 9 月之前
父节点
当前提交
8e6a991fd6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/core/src/plugin/plugin-utils.ts

+ 1 - 1
packages/core/src/plugin/plugin-utils.ts

@@ -39,7 +39,7 @@ export function createProxyHandler(options: ProxyOptions): RequestHandler {
     const proxyHostname = options.hostname || 'localhost';
     const proxyHostname = options.hostname || 'localhost';
     const middleware = createProxyMiddleware({
     const middleware = createProxyMiddleware({
         // TODO: how do we detect https?
         // TODO: how do we detect https?
-        target: `http://${proxyHostname}:${options.port}/(options.basePath || '')`,
+        target: `http://${proxyHostname}:${options.port}/${options.basePath ?? ''}`,
         pathRewrite: {
         pathRewrite: {
             [`^${route}`]: '/' + (options.basePath || ''),
             [`^${route}`]: '/' + (options.basePath || ''),
         },
         },