Skip to content

Commit 201082d

Browse files
committed
Rename :default-handler to :default-handlers
1 parent fdb99b1 commit 201082d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/duct/router/reitit.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@
5252
(assoc opts :path path)))
5353

5454
(defn- create-handlers
55-
[{:keys [default-handler file-handlers resource-handlers]}]
55+
[{:keys [default-handlers file-handlers resource-handlers]}]
5656
(concat
5757
(when file-handlers
5858
(->> (path-map->options file-handlers)
5959
(map ring/create-file-handler)))
6060
(when resource-handlers
6161
(->> (path-map->options resource-handlers)
6262
(map ring/create-resource-handler)))
63-
(when default-handler
64-
(list (ring/create-default-handler default-handler)))))
63+
(when default-handlers
64+
(list (ring/create-default-handler default-handlers)))))
6565

6666
(defmethod ig/init-key :duct.router/reitit [_ options]
6767
(let [opts (-> options

test/duct/router/reitit_test.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
:query-params {"x" "1"}
4646
:headers {"Accept" "application/json"}})))))
4747

48-
(deftest default-handler-test
48+
(deftest default-handlers-test
4949
(let [handler (constantly {:status 200, :body "Hello World"})
5050
config
5151
{:duct.router/reitit
5252
{:routes {"/" {:get {:handler handler}}
5353
"/406" {:handler (constantly nil)}}
54-
:default-handler
54+
:default-handlers
5555
{:not-found (constantly {:status 404, :body "404"})
5656
:method-not-allowed (constantly {:status 405, :body "405"})
5757
:not-acceptable (constantly {:status 406, :body "406"})}}}

0 commit comments

Comments
 (0)