mirror of
https://github.com/metosin/reitit.git
synced 2026-01-28 17:00:34 +00:00
Merge pull request #61 from yogthos/patch-1
allow custom default-handler to ring-router
This commit is contained in:
commit
8db4a1d4bf
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