diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index fd09a691..f4b21e66 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -177,6 +177,9 @@ def create_app(args): if api_key else "", version=__api_version__, + openapi_url="/openapi.json", # Explicitly set OpenAPI schema URL + docs_url="/docs", # Explicitly set docs URL + redoc_url="/redoc", # Explicitly set redoc URL openapi_tags=[{"name": "api"}], lifespan=lifespan, ) diff --git a/lightrag_webui/vite.config.ts b/lightrag_webui/vite.config.ts index 09ecd7ea..b05bf2fa 100644 --- a/lightrag_webui/vite.config.ts +++ b/lightrag_webui/vite.config.ts @@ -26,7 +26,9 @@ export default defineConfig({ target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621', changeOrigin: true, rewrite: endpoint === '/api' ? - (path) => path.replace(/^\/api/, '') : undefined + (path) => path.replace(/^\/api/, '') : + endpoint === '/docs' || endpoint === '/openapi.json' ? + (path) => path : undefined } ]) ) : {}