https://cursusdb.com/documentation#realtime-observers
https://www.npmjs.com/package/cursusdb-observer-node
import Observer from 'cursusdb-observer-node'
let ob = new Observer("yoursharedkey")
if (ob.sharedKey !== undefined) {
// To change default host
//ob.ChangeHost("1.2.3.4")
// To change default port
//ob.ChangePort(1234)
// To upgrade listener to TLS instead of TCP
//ob.UpgradeToSecureListener()
ob.Start() // Start listening
ob.events.on('event', (data) => {
console.log(data);
// Handle websocket stuff here
//..
});
}