gs-index · use cases
Publish events from a server, listen on a client:
$ gs-log >'event_log.ndjson' &
$ websocket-tail -p 8080 'event_log.ndjson'
const ws = new WebSocket("/events.ndjson?events=ProjectCreated,RoundCreated");
ws.on("message", (msg) => {
const event = JSON.parse(msg.data);
if (event.data.type === "ProjectCreated") {
displayNotification("Someone just created a project!");
}
});