Option 1: Use an existing view
If you don’t want to add a separate health check route, you can reuse an existing public view in your application. The selected view should fail with an error if a critical dependency, such as the database or another essential service, is unavailable.Option 2: Use a dedicated health check view
A dedicated health check route provides a clear and explicit way to verify your app’s health. A simple implementation can execute a lightweight query likesession.execute(text("SELECT 1")) to confirm the database is reachable. If the connection fails, an exception will be raised, and the route will return an error.