From 294e45b9b7dd2b6940665fbfca021285b0fe7a34 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 30 May 2023 22:27:15 +0200 Subject: [PATCH] pass data through --- api/views/index.ejs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/views/index.ejs b/api/views/index.ejs index e3791699..b7caed64 100644 --- a/api/views/index.ejs +++ b/api/views/index.ejs @@ -62,6 +62,11 @@ assign_button_callbacks(); window.onload = function () { const events = new EventSource("/events"); + + events.onopen = () => { + console.log("OPENED EVENT"); + } + events.onmessage = (event) => { const parsedData = JSON.parse(event.data); console.log("RECEIVED EVENT");