test(streaming): more testing on streaming the lofs

This commit is contained in:
2025-03-22 08:21:11 -05:00
parent 4db4eea2d1
commit e82ef76316
2 changed files with 35 additions and 6 deletions

View File

@@ -14,13 +14,31 @@
// // Start streaming when the button is clicked
// let es;
// const url = `http://localhost:4000/api/log`;
// const url = `http://localhost:4000/api/logger/logs/stream?service=ocme-count&level=info`;
// es = new EventSource(url, {withCredentials: true});
// es = new EventSource(url);
// es.onopen = () => console.log(">>> Connection opened!");
// es.onerror = (e) => console.log("ERROR!", e);
// es.onmessage = (e) => {
// console.log(">>>", JSON.stringify(e));
// const data = JSON.parse(e.data);
// console.log(e);
// console.log(data);
// switch (data.type) {
// case "time-update":
// console.log(data);
// break;
// case "error":
// console.log(data);
// break;
// case "done":
// console.log(data);
// es.close(); // Close the connection when done
// break;
// default:
// break;
// }
// };
// return () => es.close();