feat(server): live booth WebSocket feed (/api/ws)

Add @fastify/websocket. EventLog fires an onAppended callback after each durable
append; device-events gains a ledger channel (emitLedger). /api/ws fans out
ledger + occupancy + printer-status to authenticated booth clients. Origin
allowlist (WS_ALLOWED_ORIGINS) replaces CSRF for the handshake (anti-CSWSH).

Note: server.ts also reflects later booth route wiring; the final HEAD builds.
This commit is contained in:
2026-06-18 11:00:22 +02:00
parent 58d8f06ba0
commit c2f06a5d2a
6 changed files with 162 additions and 4 deletions
+1
View File
@@ -16,6 +16,7 @@
"@fastify/cors": "11.2.0",
"@fastify/jwt": "10.1.0",
"@fastify/static": "9.1.3",
"@fastify/websocket": "^11.2.0",
"@parking/db": "workspace:*",
"@parking/devices": "workspace:*",
"@parking/shared": "workspace:*",