✨ Allow setting the response_class to RedirectResponse and returning the URL from the function (#3457)

This commit is contained in:
Sebastián Ramírez authored and GitHub committed 2021-07-03 21:51:28 +02:00
1 parent ea8d7f689e
commit dc5a966548
13 files changed
+226 -29

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
from fastapi import FastAPI
from fastapi.responses import FileResponse
some_file_path = "large-video-file.mp4"
app = FastAPI()
@app.get("/", response_class=FileResponse)
async def main():
return some_file_path