diff --git a/ui/src/App.tsx b/ui/src/App.tsx index ed3af532a..34028785d 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -12,6 +12,8 @@ import Layout from './components/Layout'; import { TourProvider, TourOverlay, TourTooltip } from './components/tour'; import DashboardPage from './pages/DashboardPage'; +const basePath = (window as any).__BASE_PATH__ || ''; + const SkillsPage = lazy(() => import('./pages/SkillsPage')); const SkillDetailPage = lazy(() => import('./pages/SkillDetailPage')); const TargetsPage = lazy(() => import('./pages/TargetsPage')); @@ -41,7 +43,7 @@ export default function App() { - + diff --git a/ui/src/api/client.ts b/ui/src/api/client.ts index 0f6278f36..18a87302a 100644 --- a/ui/src/api/client.ts +++ b/ui/src/api/client.ts @@ -1,4 +1,5 @@ -const BASE = '/api'; +const BASE_PATH = (window as any).__BASE_PATH__ || ''; +const BASE = BASE_PATH + '/api'; export class ApiError extends Error { status: number; diff --git a/ui/vite.config.ts b/ui/vite.config.ts index ffc5f618a..93c11e820 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -8,6 +8,7 @@ import tailwindcss from '@tailwindcss/vite' const SSE_PROXY = { target: 'http://localhost:19420', headers: { Accept: 'text/event-stream' } } export default defineConfig({ + base: './', plugins: [react(), tailwindcss()], test: { environment: 'jsdom',