diff --git a/app.py b/app.py index 81472ea..4aec0fd 100644 --- a/app.py +++ b/app.py @@ -13,14 +13,12 @@ import itertools from argparse import ArgumentParser from fastapi import FastAPI, Form from fastapi.responses import JSONResponse -from fastapi.middleware.cors import CORSMiddleware class App(FastAPI): def __init__(self) -> None: super().__init__(title="Kahoot API", openapi_url=None) - self.add_middleware(CORSMiddleware, allow_origins=["*"]) - self.semaphore = asyncio.Semaphore(10) + self.semaphore = asyncio.Semaphore(5) async def connect(self, pin: int, name: str, number: int, namerator: bool = False) -> None: try: diff --git a/html/assets/favicon.ico b/html/assets/favicon.ico new file mode 100644 index 0000000..b181007 Binary files /dev/null and b/html/assets/favicon.ico differ diff --git a/html/assets/script.js b/html/assets/script.js index d816903..4e0aee8 100644 --- a/html/assets/script.js +++ b/html/assets/script.js @@ -45,14 +45,14 @@ window.onload = () => { formData.append("naming", naming.value) formData.append("name", name.value); formData.append("amount", parseInt(amount.value)); - text.value = "Flooding in progress..."; + text.innerText = "Flooding in progress..."; text.style.color = "green"; var request = await fetch("/api/flood", { method: "POST", body: formData }) response = await request.json(); - text.value = response.message; + text.innerText = response.message; if (response.type == "error") { text.style.color = "red"; diff --git a/html/index.html b/html/index.html index 2eb3f8c..8b1bd14 100644 --- a/html/index.html +++ b/html/index.html @@ -4,7 +4,7 @@