@brechtvdv/event-stream-client
Version:
Syncs an entire TREE collection, but only emits the objects, does not store them.
18 lines (16 loc) • 459 B
JavaScript
const sync = require('../lib/sync.js');
var main = async function () {
try {
let url = "http://lodi.ilabt.imec.be/coghent/objecten";
let options = {
"pollingInterval": 5000 // millis
};
let eventstreamSync = sync.createReadStream(url, options);
eventstreamSync.on('data', (data) => {
console.log(data)
})
} catch (e) {
console.error(e);
}
}
main();