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:
Automated Action 2025-06-27 15:19:23 +00:00
parent aa6c304da1
commit 7e123eab23

36
main.py
View File

@ -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",
"documentation": "/docs", "message": "FastAPI application is running successfully",
"health_check": "/health" "endpoints": {
"documentation": "/docs",
"alternative_docs": "/redoc",
"openapi_schema": "/openapi.json",
"health_check": "/health",
"debug_info": "/debug",
"api_base": "/api/v1"
}
} }
@ -47,4 +56,25 @@ async def health_check():
"status": "healthy", "status": "healthy",
"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/*"
]
} }