pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
14 lines
277 B
14 lines
277 B
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())
|
|
|