12 lines
1.0 KiB
HTML
12 lines
1.0 KiB
HTML
<p>A local HTTP API plus an event stream lets other programs subscribe to a live without scraping a window. That is the difference between a toy overlay and a maintainable ops stack.</p>
|
|
<h2>Read models</h2>
|
|
<p>Expose current room state (viewers, uptime, last event time) as a cheap GET. Expose history as a filtered query, not an unbounded dump.</p>
|
|
<h2>Event streams</h2>
|
|
<p>Server-sent events are enough for most overlays. WebSockets are warranted when you need bidirectional control. Start with SSE unless you have a reason.</p>
|
|
<h2>Auth</h2>
|
|
<p>Bind to localhost by default. If you expose beyond the machine, require a token and TLS at the reverse proxy. “It is only on the LAN” is not an access policy.</p>
|
|
<h2>Versioning</h2>
|
|
<p>Prefix routes with <code>/v1/</code>. Live ops tools get forked by tired people at 1 a.m. Breaking JSON fields without a version is how overlays die mid-show.</p>
|
|
<h2>Documentation</h2>
|
|
<p>One page with example curl calls is more valuable than a generated OpenAPI that nobody opens. Keep the examples accurate when fields change.</p>
|