Created
September 6, 2022 01:59
-
-
Save syedjafer/7f5231d9d1e45f32a11e37e8975ea2a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
var source = new EventSource("http://localhost:5000/events"); | |
source.addEventListener('dataUpdate', function(event) { | |
console.log(event); | |
}, false); | |
source.addEventListener('error', function(event) { | |
console.log("Error"+ event) | |
alert("Failed to connect to event stream. Is Redis running?"); | |
}, false); | |
</script> | |
</head> | |
<body> | |
SSE TEST | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment