From 04d23671474430bdeb4af8d61f593f942ed9f186 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 17 Oct 2025 20:36:15 +0800 Subject: [PATCH] Fix redoc access problem in front-end dev mode - Add /redoc endpoint to proxy config - Remove root path from API endpoints - Add .env.development to git reopo - Update sample environment files - Refine .gitignore patterns for env files --- .gitignore | 5 +++-- lightrag_webui/.env.development | 4 ++++ lightrag_webui/env.development.smaple | 4 +++- lightrag_webui/env.local.sample | 2 +- lightrag_webui/vite.config.ts | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 lightrag_webui/.env.development diff --git a/.gitignore b/.gitignore index 25650406..29e275b7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,10 @@ __pycache__/ # Virtual Environment .venv/ -env/ venv/ -*.env* + +# Enviroment Variable Files +.env # Build / Distribution dist/ diff --git a/lightrag_webui/.env.development b/lightrag_webui/.env.development new file mode 100644 index 00000000..5a6ac93f --- /dev/null +++ b/lightrag_webui/.env.development @@ -0,0 +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 diff --git a/lightrag_webui/env.development.smaple b/lightrag_webui/env.development.smaple index 080cf95f..5a6ac93f 100644 --- a/lightrag_webui/env.development.smaple +++ b/lightrag_webui/env.development.smaple @@ -1,2 +1,4 @@ # Development environment configuration -VITE_BACKEND_URL=/api +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 diff --git a/lightrag_webui/env.local.sample b/lightrag_webui/env.local.sample index 0cd53ad5..d8920437 100644 --- a/lightrag_webui/env.local.sample +++ b/lightrag_webui/env.local.sample @@ -1,3 +1,3 @@ VITE_BACKEND_URL=http://localhost:9621 VITE_API_PROXY=true -VITE_API_ENDPOINTS=/,/api,/documents,/graphs,/graph,/health,/query,/docs,/openapi.json,/login,/auth-status +VITE_API_ENDPOINTS=/api,/documents,/graphs,/graph,/health,/query,/docs,/redoc,/openapi.json,/login,/auth-status diff --git a/lightrag_webui/vite.config.ts b/lightrag_webui/vite.config.ts index 2957b743..5cb52992 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 === '/openapi.json' ? + endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' ? (path) => path : undefined } ])