Spaces:
Build error
Build error
changges
Browse files- display/index.html +6 -2
display/index.html
CHANGED
@@ -10,8 +10,12 @@
|
|
10 |
|
11 |
<script>
|
12 |
window.onload = () => {
|
13 |
-
const eventSource = new EventSource('/
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
</script>
|
17 |
</body>
|
|
|
10 |
|
11 |
<script>
|
12 |
window.onload = () => {
|
13 |
+
const eventSource = new EventSource('http://126.0.0.1:5555/test');
|
14 |
+
eventSource.onmessage = (event) => {
|
15 |
+
console.log("event", event);
|
16 |
+
const data = JSON.parse(event.data);
|
17 |
+
document.body.innerHTML = data.text;
|
18 |
+
};
|
19 |
}
|
20 |
</script>
|
21 |
</body>
|