commit 6e9d19a71203299b03d9359924a1c832006e45dd Author: THOLOT DECHENE Matthieu Date: Thu Jan 8 15:35:41 2026 +0000 test: Test api on raspberry diff --git a/test_api.py b/test_api.py new file mode 100644 index 0000000..a36fd11 --- /dev/null +++ b/test_api.py @@ -0,0 +1,20 @@ +from fastapi import FastAPI +from pydantic import BaseModel +import time + +app = FastAPI(title="Test API (no serial)") + +class Echo(BaseModel): + msg: str + +@app.get("/health") +def health(): + return {"ok": True, "ts": time.time()} + +@app.get("/ping") +def ping(): + return {"pong": True} + +@app.post("/echo") +def echo(body: Echo): + return {"echo": body.msg}