Implement framebuffer and mock endpoint
This commit is contained in:
@@ -6,12 +6,14 @@ from .settings import settings
|
||||
from .user import user_auth
|
||||
from .map_tiles import map_tiles, map_meta
|
||||
from .templates import j2env
|
||||
from .monitoring import monitoring
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
app.mount("/user/", user_auth)
|
||||
app.mount("/map/", map_meta)
|
||||
app.mount("/tiles/", map_tiles)
|
||||
app.mount("/monitoring/", monitoring)
|
||||
|
||||
frontend = FastAPI()
|
||||
|
||||
|
||||
25
server/server/monitoring.py
Normal file
25
server/server/monitoring.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import binascii
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from pydantic import BaseModel
|
||||
monitoring = FastAPI()
|
||||
|
||||
class ScreenContent(BaseModel):
|
||||
x: int
|
||||
y: int
|
||||
width: int
|
||||
height: int
|
||||
blink: bool
|
||||
fg: int
|
||||
text: list[str]
|
||||
fg_color: list[str]
|
||||
bg_color: list[str]
|
||||
|
||||
class Ping(BaseModel):
|
||||
screen: ScreenContent
|
||||
|
||||
@monitoring.post("/ping")
|
||||
async def ping(request: Request, data: Ping):
|
||||
print("[PING]")
|
||||
for line in data.screen.text:
|
||||
print(line)
|
||||
Reference in New Issue
Block a user