management/front/dkha-web-sz-main/node_modules/eventsource/example/sse-client.js

6 lines
161 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
var EventSource = require('..')
var es = new EventSource('http://localhost:8080/sse')
es.addEventListener('server-time', function (e) {
console.log(e.data)
})