initial
This commit is contained in:
17
reflex_ipad/api/scan.py
Normal file
17
reflex_ipad/api/scan.py
Normal 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)
|
||||
Reference in New Issue
Block a user