From ee7c683fa7268e91e3a8070e363bd7482ff195ba Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 29 Oct 2025 02:31:52 +0800 Subject: [PATCH] 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 --- lightrag_webui/.env.development | 2 +- lightrag_webui/env.development.smaple | 2 +- lightrag_webui/vite.config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightrag_webui/.env.development b/lightrag_webui/.env.development index 5a6ac93f..501be53c 100644 --- a/lightrag_webui/.env.development +++ b/lightrag_webui/.env.development @@ -1,4 +1,4 @@ # Development environment configuration VITE_BACKEND_URL=http://localhost:9621 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 diff --git a/lightrag_webui/env.development.smaple b/lightrag_webui/env.development.smaple index 5a6ac93f..501be53c 100644 --- a/lightrag_webui/env.development.smaple +++ b/lightrag_webui/env.development.smaple @@ -1,4 +1,4 @@ # Development environment configuration VITE_BACKEND_URL=http://localhost:9621 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 diff --git a/lightrag_webui/vite.config.ts b/lightrag_webui/vite.config.ts index 5cb52992..f39969c6 100644 --- a/lightrag_webui/vite.config.ts +++ b/lightrag_webui/vite.config.ts @@ -40,7 +40,7 @@ export default defineConfig({ changeOrigin: true, rewrite: endpoint === '/api' ? (path) => path.replace(/^\/api/, '') : - endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' ? + endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' || endpoint === '/static' ? (path) => path : undefined } ])