allow custom default-handler to ring-router

This commit is contained in:
Dmitri Sotnikov 2018-01-07 16:36:26 -05:00 committed by GitHub
parent b8720f581a
commit 6625cf31d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,8 +18,9 @@
(defn ring-handler
"Creates a ring-handler out of a ring-router.
Supports both 1 (sync) and 3 (async) arities."
[router]
(let [default-handler (constantly nil)]
([router]
(ring-handler router (constantly nil)))
([router default-handler]
(with-meta
(fn
([request]