Ring middleware that puts hyper's context on a request.
Ring middleware that puts hyper's context on a request.
(wrap-hyper handler app-state*)Ring middleware that adds hyper's context to the request:
:hyper/session-id — the session cookie's id when it names a session
the server holds, and a new id otherwise:hyper/tab-id — the tab-id query or form param, or a new id:hyper/app-state — app-state*It includes Ring's wrap-cookies, so :cookies is parsed on the request
and a response's :cookies are sent as Set-Cookie headers.
create-handler uses it for every request. A route outside
create-handler wraps itself in it, with the same atom passed to
create-handler as :app-state, to use hyper.ring:
(def app (ring/routes (-> auth-routes (h.ring.middleware/wrap-hyper app*)) (h/create-handler routes :app-state app*)))
Ring middleware that adds hyper's context to the request:
- `:hyper/session-id` — the session cookie's id when it names a session
the server holds, and a new id otherwise
- `:hyper/tab-id` — the `tab-id` query or form param, or a new id
- `:hyper/app-state` — `app-state*`
It includes Ring's `wrap-cookies`, so `:cookies` is parsed on the request
and a response's `:cookies` are sent as `Set-Cookie` headers.
`create-handler` uses it for every request. A route outside
`create-handler` wraps itself in it, with the same atom passed to
`create-handler` as `:app-state`, to use `hyper.ring`:
(def app
(ring/routes
(-> auth-routes (h.ring.middleware/wrap-hyper app*))
(h/create-handler routes :app-state app*)))cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |