Complete the code to import the class needed to serve static files in FastAPI.
from fastapi.staticfiles import [1]
The StaticFiles class is used in FastAPI to serve static files like images, CSS, and JavaScript.
Complete the code to mount the static files directory at the URL path '/static'.
app.mount("/static", [1](directory="static"), name="static")
The StaticFiles instance is mounted on the app to serve files from the 'static' directory at the '/static' URL path.
Fix the error in the code to correctly serve static files from the 'assets' folder at '/assets'.
app.mount("/assets", StaticFiles(directory=[1]), name="assets")
The directory argument must be a string with the folder name. Here, it should be "assets" to match the folder.
Fill both blanks to create a FastAPI app that serves static files from 'public' at '/public'.
from fastapi import FastAPI from fastapi.staticfiles import [1] app = [2]() app.mount("/public", StaticFiles(directory="public"), name="public")
You import StaticFiles to serve static files and create the app with FastAPI().
Fill all three blanks to serve static files from 'assets' at '/assets' with a FastAPI app.
from fastapi import [1] from fastapi.staticfiles import [2] app = [3]() app.mount("/assets", StaticFiles(directory="assets"), name="assets")
Import FastAPI and StaticFiles, then create the app with FastAPI().