parent
3e7aa01e34
commit
2eedef5398
@ -0,0 +1,29 @@ |
||||
<!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> |
Loading…
Reference in new issue