Debian Codegraph @

docs_src/custom_response/tutorial009b_py310.py

raw
1 from fastapi import FastAPI
2 from fastapi.responses import FileResponse
3
4 some_file_path = "large-video-file.mp4"
5 app = FastAPI()
6
7
8 @app.get("/", response_class=FileResponse)
9 async def main():
10 return some_file_path