Add explicit docs configuration and debug endpoints
- Explicitly configure docs_url and redoc_url in FastAPI app
- Add /debug endpoint to verify FastAPI is running correctly
- Enhance root endpoint with more helpful information
- Helps troubleshoot reverse proxy configuration issues
🤖 Generated with BackendIM
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
aa6c304da1
commit
7e123eab23
34
main.py
34
main.py
@ -12,7 +12,9 @@ app = FastAPI(
|
|||||||
title=settings.APP_NAME,
|
title=settings.APP_NAME,
|
||||||
version=settings.APP_VERSION,
|
version=settings.APP_VERSION,
|
||||||
description="AI-Powered Resume & Job Match Hub - Helping job seekers find the perfect match",
|
description="AI-Powered Resume & Job Match Hub - Helping job seekers find the perfect match",
|
||||||
openapi_url="/openapi.json"
|
openapi_url="/openapi.json",
|
||||||
|
docs_url="/docs",
|
||||||
|
redoc_url="/redoc"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configure CORS
|
# Configure CORS
|
||||||
@ -35,8 +37,15 @@ async def root():
|
|||||||
"service": settings.APP_NAME,
|
"service": settings.APP_NAME,
|
||||||
"version": settings.APP_VERSION,
|
"version": settings.APP_VERSION,
|
||||||
"description": "AI-Powered Resume & Job Match Hub",
|
"description": "AI-Powered Resume & Job Match Hub",
|
||||||
|
"message": "FastAPI application is running successfully",
|
||||||
|
"endpoints": {
|
||||||
"documentation": "/docs",
|
"documentation": "/docs",
|
||||||
"health_check": "/health"
|
"alternative_docs": "/redoc",
|
||||||
|
"openapi_schema": "/openapi.json",
|
||||||
|
"health_check": "/health",
|
||||||
|
"debug_info": "/debug",
|
||||||
|
"api_base": "/api/v1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -48,3 +57,24 @@ async def health_check():
|
|||||||
"service": settings.APP_NAME,
|
"service": settings.APP_NAME,
|
||||||
"version": settings.APP_VERSION
|
"version": settings.APP_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/debug")
|
||||||
|
async def debug_info():
|
||||||
|
"""Debug endpoint to verify FastAPI is running"""
|
||||||
|
import os
|
||||||
|
return {
|
||||||
|
"message": "FastAPI application is running",
|
||||||
|
"service": settings.APP_NAME,
|
||||||
|
"version": settings.APP_VERSION,
|
||||||
|
"python_version": os.sys.version,
|
||||||
|
"available_endpoints": [
|
||||||
|
"/",
|
||||||
|
"/health",
|
||||||
|
"/debug",
|
||||||
|
"/docs",
|
||||||
|
"/redoc",
|
||||||
|
"/openapi.json",
|
||||||
|
"/api/v1/*"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user