Add /health endpoint to FastAPI application
This commit is contained in:
parent
8ba4d8c98d
commit
804b4d51a3
4
main.py
4
main.py
@ -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)
|
Loading…
x
Reference in New Issue
Block a user