Skip to content
masterclass Buddy

FastAPI · Method

app.mount

Use StaticFiles with app.mount() to serve files from a directory under a URL prefix. The mounted application handles that prefix independently from the main FastAPI app.

Last updated

Syntax

app.mount(path, app, name=None)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • StaticFiles
  • app.frontend()
  • FastAPI
  • root_path
  • APIRouter

Source: Static Files - FastAPI. Checked 2026-11-03.