Company
Date Published
Sept. 17, 2024
Author
Tilde Thurium
Word count
1314
Language
English
Hacker News points
None

Summary

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.