Day: August 17, 2025

  • Using Background Tasks in FastAPI for Non-Blocking Operations

    Using Background Tasks in FastAPI for Non-Blocking Operations

    FastAPI makes it delightfully simple to build high-performance APIs, but one common need in modern web development is to handle background work — like sending emails, updating statistics, or triggering other time-consuming tasks — without making the user wait. In this article, I’ll walk you through FastAPI’s built-in support for background tasks, how to use…

  • Introducing Custom Middleware in FastAPI: A Practical Walkthrough

    Introducing Custom Middleware in FastAPI: A Practical Walkthrough

    If you’re building an API with FastAPI, eventually you’ll need to address aspects like logging, authentication, request throttling, or response manipulation—all of which often span multiple routes. Rather than cluttering your endpoints or dependencies, FastAPI middleware lets you inject logic that acts before and after every request. In this article, I’ll show you how to…