Explicitly set API docs and schema URLs.

- 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
This commit is contained in:
yangdx
2025-03-13 12:38:33 +08:00
parent d72832c275
commit 002d675dc6
2 changed files with 6 additions and 1 deletions

View File

@@ -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
}
])
) : {}