rcpch / digital-growth-charts-server

RCPCH's open source Digital Growth Chart API
https://growth.rcpch.ac.uk/
GNU Affero General Public License v3.0
16 stars 11 forks source link

'Healthcheck' endpoint on the API - requested by customer #202

Open pacharanero opened 8 months ago

pacharanero commented 8 months ago

One of our larger customers has requested that there be a 'healthcheck' endpoint which they can use to verify the API is working, this will be called approximtely once per minute and should just return a "200 OK" response which is enough for their systems to ascertain the API is available.

This is fairly easy to implement in FastAPI and would be a good issue for anyone wanting to learn more about FastAPI. We already have the root / response returning the openAPI3 spec so I would pick something like /health/ and return a 200 OK and the current time on the server (to help prevent caching, or at least to make it obvious if caching is going on)

Here's some background info on the idea of healthcheck APIs https://microservices.io/patterns/observability/health-check-api.html