tenebrous-dicebot/api/node_modules/eventsource/example/sse-client.js

6 lines
161 B
JavaScript
Raw Normal View History

var EventSource = require('..')
var es = new EventSource('http://localhost:8080/sse')
es.addEventListener('server-time', function (e) {
console.log(e.data)
})