mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 04:17:03 +00:00
add server side events via broker example (based on external resource but it is fairly good for a simple SSE showcase)
Former-commit-id: 926c2a88bf1c44354a99654bc85e267b940723b8
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<!-- you can just put that to your favourite browser -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>SSE (javascript side)</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
var client = new EventSource("http://localhost:8080")
|
||||
client.onmessage = function (msg) {
|
||||
console.log(msg)
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Open the browser's console(F12) and watch for icoming event messages</h1>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user