mirror of
https://github.com/metosin/reitit.git
synced 2026-02-15 07:45:17 +00:00
allow custom default-handler to ring-router
This commit is contained in:
parent
b8720f581a
commit
6625cf31d7
1 changed files with 3 additions and 2 deletions
|
|
@ -18,8 +18,9 @@
|
||||||
(defn ring-handler
|
(defn ring-handler
|
||||||
"Creates a ring-handler out of a ring-router.
|
"Creates a ring-handler out of a ring-router.
|
||||||
Supports both 1 (sync) and 3 (async) arities."
|
Supports both 1 (sync) and 3 (async) arities."
|
||||||
[router]
|
([router]
|
||||||
(let [default-handler (constantly nil)]
|
(ring-handler router (constantly nil)))
|
||||||
|
([router default-handler]
|
||||||
(with-meta
|
(with-meta
|
||||||
(fn
|
(fn
|
||||||
([request]
|
([request]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue