- proxy Go /api/stream through Nitro; drive /stage, /live, /plan and /forecast from scenario events - fall back to 5 s polling after SSE failures or heartbeat silence; show Live/Polling/Offline - authenticate /control and POST /api/scenario in Nitro with server-side control credentials - add big-screen stage with local QR and a no-login phone recommendation view - add SSE unit tests and a live smoke test; refresh README/Makefile
9 lines
316 B
TypeScript
9 lines
316 B
TypeScript
import type { ScenarioState } from '../../shared/types'
|
|
import { apiRequest, isMockMode } from '../utils/api'
|
|
import { getMockScenario } from '../utils/mock-scenario'
|
|
|
|
export default defineEventHandler(async () => {
|
|
if (isMockMode()) return getMockScenario()
|
|
return apiRequest<ScenarioState>('/api/scenario')
|
|
})
|