File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 52
52
(assoc opts :path path)))
53
53
54
54
(defn- create-handlers
55
- [{:keys [default-handler file-handlers resource-handlers]}]
55
+ [{:keys [default-handlers file-handlers resource-handlers]}]
56
56
(concat
57
57
(when file-handlers
58
58
(->> (path-map->options file-handlers)
59
59
(map ring/create-file-handler)))
60
60
(when resource-handlers
61
61
(->> (path-map->options resource-handlers)
62
62
(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 )))))
65
65
66
66
(defmethod ig /init-key :duct.router/reitit [_ options]
67
67
(let [opts (-> options
Original file line number Diff line number Diff line change 45
45
:query-params {" x" " 1" }
46
46
:headers {" Accept" " application/json" }})))))
47
47
48
- (deftest default-handler -test
48
+ (deftest default-handlers -test
49
49
(let [handler (constantly {:status 200 , :body " Hello World" })
50
50
config
51
51
{:duct.router/reitit
52
52
{:routes {" /" {:get {:handler handler}}
53
53
" /406" {:handler (constantly nil )}}
54
- :default-handler
54
+ :default-handlers
55
55
{:not-found (constantly {:status 404 , :body " 404" })
56
56
:method-not-allowed (constantly {:status 405 , :body " 405" })
57
57
:not-acceptable (constantly {:status 406 , :body " 406" })}}}
You can’t perform that action at this time.
0 commit comments