To support zero-downtime deployments, configure a health check endpoint in your Flask application. This endpoint allows Sevalla to verify that your app is running correctly before routing traffic to it. There are multiple ways to implement a health check in Flask, depending on the level of control and visibility required.Documentation Index
Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
Use this file to discover all available pages before exploring further.
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.