Browse Source

Add small health_status() helper function for FastAPI utils

pull/14308/head
Sivesh Kumar 9 months ago
parent
commit
dc7101fc5c
  1. 15
      fastapi/utils/status_check.py

15
fastapi/utils/status_check.py

@ -0,0 +1,15 @@
from datetime import datetime
def health_status() -> dict:
"""
Returns a simple health status for FastAPI.
This is a small helper function that could be used in health checks.
"""
return {
"status": "ok",
"time": datetime.utcnow().isoformat() + "Z"
}
if __name__ == "__main__":
print(health_status())
Loading…
Cancel
Save