[+] HTML endpoint
This commit is contained in:
@@ -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):
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+2
-1
@@ -1,4 +1,5 @@
|
||||
const HOST = 'http://127.0.0.1:8249'
|
||||
// const HOST = 'http://127.0.0.1:8249'
|
||||
const HOST = window.location.origin
|
||||
|
||||
export type Dict = Record<string, any>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user