From a5ed8b7de7e1c838655905c12a16c690669fdafd Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 23 Mar 2025 00:58:19 -0400 Subject: [PATCH] [+] HTML endpoint --- src/receiver.py | 8 ++++++++ web/dist/index.html | 4 ++-- web/src/sdk.ts | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/receiver.py b/src/receiver.py index b5396a9..99a0ab5 100644 --- a/src/receiver.py +++ b/src/receiver.py @@ -6,6 +6,7 @@ import uvicorn import winsound from fastapi import FastAPI, HTTPException from fastapi.middleware.cors import CORSMiddleware +from starlette.responses import HTMLResponse from vk import press_key, release_key @@ -24,6 +25,13 @@ app.add_middleware( PATH = Path('aime.txt') AUDIO_EFFECT = Path(__file__).parent / 'audio/mixkit-gaming-lock-2848.wav' +HTML = Path(__file__).parent.parent / "web/dist/index.html" + + +@app.get("/", response_class=HTMLResponse) +def read_root(): + return HTML.read_text() + @app.post("/scan") def scan(uid: str): diff --git a/web/dist/index.html b/web/dist/index.html index 3ca8388..be74553 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -5,8 +5,8 @@