Created a basic FastAPI app with a POST endpoint for receiving wave files.

This commit is contained in:
Timothy Farrell (aider) 2024-07-15 10:56:42 -05:00
parent 4685b8b7a2
commit 1518557c32
2 changed files with 11 additions and 0 deletions

9
app.py Normal file
View File

@ -0,0 +1,9 @@
from fastapi import FastAPI, File, UploadFile
app = FastAPI()
@app.post("/uploadfile/")
async def upload_file(file: UploadFile = File(...)):
contents = await file.read()
# Here you can process the WAV file data stored in 'contents'
return {"filename": file.filename}

View File

@ -6,6 +6,8 @@ authors = ["Timothy Farrell <tim@thecookiejar.me>"]
[tool.poetry.dependencies]
python = "^3.8"
fastapi = "^0.75.2"
uvicorn = {extras = ["standard"], version = "^0.17.6"}
[build-system]
requires = ["poetry-core>=1.0.0"]