add_directory
add_directory
Mount a new directory at a URL route. A leading / is added automatically
if missing. Raises ValueError if the directory does not exist or the path
is not a directory.
If the FastAPI app is already running, the new directory is mounted immediately.
Parameters
route
URL path to mount at (e.g., "/docs"). A leading / is added automatically
if missing.
directory
Local directory path to serve.
Returns
None