Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: add REACT_APP_BASE_URL

shuaieb6dc3e3dc4f
diff --git a/ui/.env.production b/ui/.env.production
index 33d84710..5e1007e7 100644
--- a/ui/.env.production
+++ b/ui/.env.production
@@ -2,3 +2,4 @@ TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true
PUBLIC_URL = /
REACT_APP_API_URL = /
+REACT_APP_BASE_URL = ""
diff --git a/ui/src/App.tsx b/ui/src/App.tsx
index c15c1771..affac7a9 100644
--- a/ui/src/App.tsx
+++ b/ui/src/App.tsx
@@ -25,7 +25,9 @@ import '@/utils/pluginKit';
import routes from '@/router';
function App() {
- const router = createBrowserRouter(routes);
+ const router = createBrowserRouter(routes, {
+ basename: process.env.REACT_APP_BASE_URL,
+ });
return <RouterProvider router={router} />;
}