No matching definitions.

tourist-ws/route

src/tourist-ws/route.tur
defn

ws-route!

(ws-route! [path : cstr ^fat handler : (fn [WsConn])

declare a tourist route that upgrades to a WebSocket.

pathroute pattern string, e.g. "/ws" or "/feed/:room".
handler(fn [WsConn] void), run after a successful upgrade.

:int -- a tourist route Item, to be passed to tourist-conn.

(ws-route! "/echo"
    (fn [ws : WsConn] : void
      (let [f (ws-server-recv ws)]
        (ws-server-send ws (ws-frame-text f))
        (ws-server-close ws))))

Since: TOUR-V0