feat(deploy): add portable external-service stack

This commit is contained in:
2026-07-11 22:12:21 +02:00
parent 715de6649b
commit 767df63a33
7 changed files with 265 additions and 1 deletions
+3
View File
@@ -77,6 +77,9 @@ export function sessionRoutes(
"Access-Control-Allow-Origin": origin,
"Access-Control-Allow-Credentials": "true",
});
// Send the handshake immediately. Without this, Node waits for the first event body and
// proxies/clients cannot establish an idle SSE subscription or inspect its headers.
reply.raw.flushHeaders();
const send = (event: string, data: object) => reply.raw.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
const off = d.hub.subscribe(id, send, rt?.bridge.pendingWidget() ?? null);
req.raw.on("close", off);