Input
GET /health (immediately after the app starts)
Output
200 OK
{"status": "ok", "uptime_seconds": 0}Right at boot, uptime hasn't accumulated a full second yet.
Add a `GET /health` route to the FastAPI app in `main.py`. The route must return a JSON response with two fields: `status` (always the string `"ok"`) and `uptime_seconds` (the number of whole seconds since the app start...
main.pyEditable starterGET /health (immediately after the app starts)
200 OK
{"status": "ok", "uptime_seconds": 0}Right at boot, uptime hasn't accumulated a full second yet.
GET /health (10 seconds after the app starts)
200 OK
{"status": "ok", "uptime_seconds": 10}Uptime grows as the process keeps running. Always returns whole seconds, never fractional.
How would you extend `/health` to also report the status of each external dependency (database, Redis, etc.) without making the route slow under normal traffic?