You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
618 B
30 lines
618 B
1 year ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
|
||
|
<meta charset="utf-8" />
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
<link rel="icon" href="https://glitch.com/favicon.ico" />
|
||
|
<title>offtopus events</title>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="content"></div>
|
||
|
<hr>
|
||
|
<div id="events"></div>
|
||
|
|
||
|
<script>
|
||
|
const source = new EventSource('/events');
|
||
|
|
||
|
source.addEventListener('message', message => {
|
||
|
console.log('Got', message);
|
||
|
|
||
|
// Display the event data in the `content` div
|
||
|
document.querySelector('#events').innerHTML = event.data;
|
||
|
})
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|