Getting ready for server-sent events with node.js

As the Spark publish feature is about to come, I try to inform myself about SSE - which I guess for many is brand new.

For the backend, I would like to work with node.js, which luckily seems to be a great fit for this. I assume the Spark team is already testing and trying this feature - could you let us know which node.js npm library you are using?

For example, there is SSE: https://www.npmjs.org/package/sse - is this a good recommendation in your idea?

1 Like

Hmm, this is a great question! I haven’t picked a library, I’m actually just reviewing them right now and thinking about what makes the most sense. Typically I try to pick projects that have a lot of community interaction and have a lot of contributions. :slight_smile: I’ll let you know which way I go.

Thanks,
David

Hmm, sending server sent events looks really pretty straightforward, using that package would probably work, I found it easier to just write the responses directly. I think I’ll share a code snippet when I’ve confirmed things are working. :slight_smile:

The spec is here: http://www.whatwg.org/specs/web-apps/current-work/#server-sent-events

Mostly it’s just keeping the connection open with a few special headers

I am more interested in receiving the events from the spark cloud. Looks as well simple, but a stable, reconnecting, msg delimiting node api probably is quite handy.