To support zero-downtime deployments, configure a health check endpoint in your FastAPI 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 FastAPI, 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 endpoint
If you prefer not to create a separate health check path, you can use any existing public endpoint in your app. Choose a path that will return an error if a critical service, like your database, is not functioning correctly.Option 2: Use a dedicated health check endpoint
A dedicated health check endpoint allows you to explicitly verify the health of your app’s dependencies. For example, you can check database connectivity by executing a simple query such assession.exec(text("SELECT 1")). If the connection fails, the endpoint will return an error.