Fix swagger docs page problem in dev mode

- Add /static to VITE_API_ENDPOINTS
- Update proxy rewrite rules
- Include static file serving
- Sync sample env file
This commit is contained in:
yangdx 2025-10-29 02:31:52 +08:00
parent 54c48dce38
commit ee7c683fa7
3 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# Development environment configuration # Development environment configuration
VITE_BACKEND_URL=http://localhost:9621 VITE_BACKEND_URL=http://localhost:9621
VITE_API_PROXY=true VITE_API_PROXY=true
VITE_API_ENDPOINTS=/api,/documents,/graphs,/graph,/health,/query,/docs,/redoc,/openapi.json,/login,/auth-status VITE_API_ENDPOINTS=/api,/documents,/graphs,/graph,/health,/query,/docs,/redoc,/openapi.json,/login,/auth-status,/static

View file

@ -1,4 +1,4 @@
# Development environment configuration # Development environment configuration
VITE_BACKEND_URL=http://localhost:9621 VITE_BACKEND_URL=http://localhost:9621
VITE_API_PROXY=true VITE_API_PROXY=true
VITE_API_ENDPOINTS=/api,/documents,/graphs,/graph,/health,/query,/docs,/redoc,/openapi.json,/login,/auth-status VITE_API_ENDPOINTS=/api,/documents,/graphs,/graph,/health,/query,/docs,/redoc,/openapi.json,/login,/auth-status,/static

View file

@ -40,7 +40,7 @@ export default defineConfig({
changeOrigin: true, changeOrigin: true,
rewrite: endpoint === '/api' ? rewrite: endpoint === '/api' ?
(path) => path.replace(/^\/api/, '') : (path) => path.replace(/^\/api/, '') :
endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' ? endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' || endpoint === '/static' ?
(path) => path : undefined (path) => path : undefined
} }
]) ])