This commit is contained in:
2024-01-04 09:02:44 +01:00
parent ed19c7c6cb
commit 689c71deb1
48 changed files with 1464 additions and 0 deletions

17
reflex_ipad/api/scan.py Normal file
View File

@@ -0,0 +1,17 @@
import reflex as rx
from reflex_ipad.models import *
from sqlmodel import Field, Session, SQLModel, create_engine, select
import time
async def scan(uuid: str):
print(uuid)
with rx.session() as session:
scan = Scan(uuid=uuid, timestamp=time.time())
session.add(scan)
session.commit()
return scan.as_dict()
def register_at(app):
print("register scan")
app.api.add_api_route("/scan/{uuid}", scan)