Skip to content

Commit d713437

Browse files
author
mohamedachrefhacheni
committed
add health check point
1 parent ba1706b commit d713437

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/app/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def custom_generate_unique_id(route: APIRoute) -> str:
2020
generate_unique_id_function=custom_generate_unique_id,
2121
)
2222

23+
# Add health check endpoint directly to main app
24+
@app.get("/health", tags=["health"])
25+
async def health_check():
26+
return {"status": "ok", "message": "Service is healthy"}
27+
2328
# Set all CORS enabled origins
2429
if settings.all_cors_origins:
2530
app.add_middleware(
@@ -30,4 +35,4 @@ def custom_generate_unique_id(route: APIRoute) -> str:
3035
allow_headers=["*"],
3136
)
3237

33-
app.include_router(api_router, prefix=settings.API_V1_STR)
38+
app.include_router(api_router, prefix=settings.API_V1_STR)

0 commit comments

Comments
 (0)