chi icon indicating copy to clipboard operation
chi copied to clipboard

Is there a way to mount a Server-Sent Event server along side other routes in Chi?

Open sivasiva opened this issue 9 years ago • 1 comments

Most SSE implementations I see in the wild are standalone servers that just serve the events at / or http.Handle("/events/", b).

I would like to know if it is possible to mount an Event Server on a route along other Chi routes.

If yes, can you please provide some pointers on how that might be accomplished?

Awesome router btw, thanks for a really neat library.

sivasiva avatar Mar 18 '17 19:03 sivasiva

hey @sivasiva - absolute, this would work with chi just as:

r := chi.NewRouter()
r.Handle("/events/", b)

pkieltyka avatar Mar 20 '17 14:03 pkieltyka