Buckaroo.Router (buckaroo v0.3.2) View Source

An extension to Plug.Router now also supporting websocket.

Link to this section Summary

Functions

Dispatches to the event source.

Dispatches to the websocket.

Link to this section Functions

Link to this macro

sse(expr, opts)

View Source (macro)

Dispatches to the event source.

Server-Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via HTTP connection.

See Plug.Router.match/3 for more examples.

Example

sse "/eventsource", source: ExampleEventSource
Link to this macro

websocket(expr, opts)

View Source (macro)

Dispatches to the websocket.

See Plug.Router.match/3 for more examples.

Example

websocket "/ws", connect: ExampleSocket