yangdx commited on
Commit
d217504
·
1 Parent(s): b453e7c

Explicitly set API docs and schema URLs.

Browse files

- Set OpenAPI schema URL to `/openapi.json`
- Set docs URL to `/docs`
- Set redoc URL to `/redoc`
- Update Vite config for API docs routing
- Ensure proper path handling for docs endpoints

lightrag/api/lightrag_server.py CHANGED
@@ -177,6 +177,9 @@ def create_app(args):
177
  if api_key
178
  else "",
179
  version=__api_version__,
 
 
 
180
  openapi_tags=[{"name": "api"}],
181
  lifespan=lifespan,
182
  )
 
177
  if api_key
178
  else "",
179
  version=__api_version__,
180
+ openapi_url="/openapi.json", # Explicitly set OpenAPI schema URL
181
+ docs_url="/docs", # Explicitly set docs URL
182
+ redoc_url="/redoc", # Explicitly set redoc URL
183
  openapi_tags=[{"name": "api"}],
184
  lifespan=lifespan,
185
  )
lightrag_webui/vite.config.ts CHANGED
@@ -26,7 +26,9 @@ export default defineConfig({
26
  target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
27
  changeOrigin: true,
28
  rewrite: endpoint === '/api' ?
29
- (path) => path.replace(/^\/api/, '') : undefined
 
 
30
  }
31
  ])
32
  ) : {}
 
26
  target: import.meta.env.VITE_BACKEND_URL || 'http://localhost:9621',
27
  changeOrigin: true,
28
  rewrite: endpoint === '/api' ?
29
+ (path) => path.replace(/^\/api/, '') :
30
+ endpoint === '/docs' || endpoint === '/openapi.json' ?
31
+ (path) => path : undefined
32
  }
33
  ])
34
  ) : {}