mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-24 06:39:31 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
15 lines
277 B
Python
15 lines
277 B
Python
from fastapi import FastAPI
|
|
from fastapi.responses import StreamingResponse
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
async def fake_video_streamer():
|
|
for i in range(10):
|
|
yield b"some fake video bytes"
|
|
|
|
|
|
@app.get("/")
|
|
async def main():
|
|
return StreamingResponse(fake_video_streamer())
|