Complete the code to define a basic health check endpoint that returns a 200 status.
GET /health [1] 200 OK
The health check endpoint should return a 200 OK status to indicate the service is healthy.
Complete the code to add a readiness check endpoint that verifies database connectivity.
if database.[1](): return 200 else: return 503
The readiness check often uses a ping method to verify if the database is reachable.
Fix the error in the health check response code to correctly indicate service health.
def health_check(): return 'Service is healthy', [1]
The health check should return HTTP status code 200 to indicate the service is healthy.
Fill both blanks to create a health check that returns JSON with status.
def health_check(): return [1], [2]
The health check should return a JSON body with status and a 200 status code.
Fill all three blanks to implement a readiness check that returns 200 if cache and DB are healthy, else 503.
def readiness_check(): if cache.[1]() and db.[2](): return [3] else: return 503
The readiness check calls ping on cache and is_alive on db, returning 200 if both are healthy.