push updated state to clients over SSE (ISS-129)
CI / build + unit + e2e (pull_request) Successful in 11m7s
CI / build + unit + e2e (pull_request) Successful in 11m7s
This commit is contained in:
@@ -51,6 +51,22 @@ export const openApiSpec = {
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/events': {
|
||||
get: {
|
||||
summary: 'Live state stream (SSE)',
|
||||
description:
|
||||
'Server-Sent Events feed of full game-state snapshots (v0.57.0, ISS-129) — the current snapshot is sent immediately on connect and a fresh one after every sim tick (~1 s), so clients can subscribe instead of polling /api/state. Each event\'s data payload is JSON with exactly the StateSnapshot shape; comment lines starting with ":" are heartbeats.',
|
||||
operationId: 'subscribeToEvents',
|
||||
responses: {
|
||||
200: {
|
||||
description: 'SSE stream of state snapshots (text/event-stream)',
|
||||
content: {
|
||||
'text/event-stream': { schema: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/version': {
|
||||
get: {
|
||||
summary: 'App version',
|
||||
|
||||
Reference in New Issue
Block a user