Documentation Index
Fetch the complete documentation index at: https://docs.nolongerevil.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
/api/events is a Server-Sent Events (SSE) endpoint that streams a lightweight notification whenever any device’s state changes. Use it to keep a UI or integration updated without polling /status repeatedly.
Endpoint
Response
The endpoint sends an SSE stream. Each event has:GET /status?serial={serial} call.
Response Headers
The
X-Accel-Buffering: no header is included for nginx compatibility. Without it, nginx may buffer the stream and delay delivery of events.Examples
Behavior
- The connection stays open indefinitely until the client disconnects.
- Events are emitted whenever a device state change is processed (subscribe PUT, command execution).
- There is no initial burst of events on connection — only future changes are sent.
- If the server restarts, the SSE connection will drop and the client must reconnect.
Use Case: Live Dashboard
Related
GET /status
Get full device state after an event
POST /notify-device
Manually trigger a push to subscribers