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
This commit is contained in:
yangdx 2025-10-17 20:36:15 +08:00
parent 4c3ab58473
commit 04d2367147
5 changed files with 12 additions and 5 deletions

5
.gitignore vendored
View file

@ -9,9 +9,10 @@ __pycache__/
# Virtual Environment # Virtual Environment
.venv/ .venv/
env/
venv/ venv/
*.env*
# Enviroment Variable Files
.env
# Build / Distribution # Build / Distribution
dist/ dist/

View file

@ -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

View file

@ -1,2 +1,4 @@
# Development environment configuration # 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

View file

@ -1,3 +1,3 @@
VITE_BACKEND_URL=http://localhost:9621 VITE_BACKEND_URL=http://localhost:9621
VITE_API_PROXY=true 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

View file

@ -40,7 +40,7 @@ export default defineConfig({
changeOrigin: true, changeOrigin: true,
rewrite: endpoint === '/api' ? rewrite: endpoint === '/api' ?
(path) => path.replace(/^\/api/, '') : (path) => path.replace(/^\/api/, '') :
endpoint === '/docs' || endpoint === '/openapi.json' ? endpoint === '/docs' || endpoint === '/redoc' || endpoint === '/openapi.json' ?
(path) => path : undefined (path) => path : undefined
} }
]) ])