Stateful router management for runtime route/tap modifications. Tracks dynamic routes and taps in atoms, rebuilds the handler via platform's swap-handler!.
Stateful router management for runtime route/tap modifications. Tracks dynamic routes and taps in atoms, rebuilds the handler via platform's swap-handler!.
(clear-all-state!)Clear ALL dynamic state including taps. Use for full cleanup.
Clear ALL dynamic state including taps. Use for full cleanup.
(clear-dynamic-state!)Clear ephemeral dynamic state on reset. Taps are NOT cleared — they persist across resets because (reset) is the documented way to activate them.
Clear ephemeral dynamic state on reset. Taps are NOT cleared — they persist across resets because (reset) is the documented way to activate them.
(rebuild-router! base-routes compile-fn swap-fn)Rebuild the HTTP handler with current dynamic routes and taps applied.
Rebuild the HTTP handler with current dynamic routes and taps applied.
(wrap-dynamic-dispatch base-handler)Ring middleware that checks dynamic routes via a Reitit router. Supports path parameters (e.g. /api/foo/:id matches /api/foo/123). Matched requests go through the standard HTTP middleware stack (params, cookies, content negotiation/body parsing via Muuntaja) so dynamic handlers behave like normal Boundary routes. Otherwise the request falls through to the base handler.
Ring middleware that checks dynamic routes via a Reitit router. Supports path parameters (e.g. /api/foo/:id matches /api/foo/123). Matched requests go through the standard HTTP middleware stack (params, cookies, content negotiation/body parsing via Muuntaja) so dynamic handlers behave like normal Boundary routes. Otherwise the request falls through to the base handler.
(wrap-taps base-handler)Ring middleware that invokes registered tap callbacks. Uses the Reitit router (from handler metadata) to pre-match the request. Matches taps in order of preference:
Ring middleware that invokes registered tap callbacks.
Uses the Reitit router (from handler metadata) to pre-match the request.
Matches taps in order of preference:
1. Route :name keyword (exact match — works for all named routes)
2. Handler function string (regex match — fallback for unnamed routes)
The tap receives {:request request :match match-data} and its return
value replaces the context (allowing request modification).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 |