Quickly disable external API calls in your FastAPI application using FastAPI and LaunchDarkly kill switch flags
This tutorial demonstrates how to add a kill switch feature flag to disable third-party API calls in a FastAPI application using the LaunchDarkly Python SDK. The Dad Jokes API is used as an example data source. FastAPI, a new Python framework, offers benefits such as built-in concurrency support and auto-generated interactive documentation. The tutorial covers setting up a local developer environment with Python and pip installed, creating a requirements.txt file for dependencies, and building the FastAPI application. It also explains how to configure LaunchDarkly kill switch flags and integrate them into the FastAPI application using lifespan events. Finally, it demonstrates how to test the feature flag by enabling and disabling it in the LaunchDarkly dashboard.
Company
LaunchDarkly
Date published
Sept. 17, 2024
Author(s)
Tilde Thurium
Word count
1314
Hacker News points
None found.
Language
English