Skip to content

research-clone/http-streaming-fastapi-js-playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Streaming with FastAPI and JS

Installation

pip install -r requirements.txt

Run the server

uvicorn api:app 

There are two endpoints,

  • /file -> send a file
  • /stream -> creates server sent events

Then, run the client (install node)

node main.ts

Have a look inside, there are two functions fetch_stream and fetch_file_stream the first one consumes the server sent event and the second the file - both are HTTP streaming requests resulting in a ReadableStream class

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 51.9%
  • Python 48.1%