proper SSE handling
This commit is contained in:
@@ -24,9 +24,10 @@ export async function sseRoutes(
|
|||||||
reply.sse.keepAlive();
|
reply.sse.keepAlive();
|
||||||
|
|
||||||
const clientId = randomUUID();
|
const clientId = randomUUID();
|
||||||
const sendEvent = (data: SseEvent) => {
|
const sendEvent = (event: SseEvent) => {
|
||||||
reply.sse.send({
|
reply.sse.send({
|
||||||
data: data,
|
event: event.type,
|
||||||
|
data: event.data,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user