Created a basic FastAPI app with a POST endpoint for receiving wave files.
This commit is contained in:
parent
4685b8b7a2
commit
1518557c32
9
app.py
Normal file
9
app.py
Normal 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}
|
||||
@ -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"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user