add client receiving base

This commit is contained in:
2025-05-04 14:17:20 +02:00
parent fbbaabb04b
commit 194fd2adea
9 changed files with 228 additions and 2 deletions

View File

@@ -85,10 +85,17 @@ def read_file(filepath: str) -> str:
@dataclass
class StaticFiles:
index_html: str = read_file("static/index.html")
script_js: str = read_file("static/script.js")
@app.get("/presentation/")
async def presentation_index(_: Request):
return HTMLResponse(status_code=200, content=StaticFiles.index_html)
return HTMLResponse(status_code=200, content=StaticFiles.index_html, media_type="text/html")
@app.get("/presentation/script.js")
async def presentation_script(_: Request):
return HTMLResponse(
status_code=200, content=StaticFiles.script_js, media_type="text/javascript"
)
# Endpoints
@app.post("/control")