Add /health endpoint to FastAPI application

This commit is contained in:
Automated Action 2025-05-11 20:13:26 +00:00
parent 8ba4d8c98d
commit 804b4d51a3

View File

@ -29,5 +29,9 @@ app.include_router(todos.router, prefix="/api")
def root(): def root():
return {"message": "Welcome to Todo API"} return {"message": "Welcome to Todo API"}
@app.get("/health")
def health():
return {"status": "healthy"}
if __name__ == "__main__": if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)