WIP
This commit is contained in:
22
main.py
Normal file
22
main.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from poo import PooRecorder
|
||||
|
||||
recorder = PooRecorder()
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def _lifespan(_app: FastAPI):
|
||||
await recorder.start()
|
||||
yield
|
||||
await recorder.stop()
|
||||
|
||||
|
||||
app = FastAPI(lifespan=_lifespan)
|
||||
|
||||
|
||||
@app.put("/record/s={status}")
|
||||
async def record(status: str) -> dict:
|
||||
return {"status": status}
|
||||
Reference in New Issue
Block a user