Polish code

This commit is contained in:
Tommi Reiman 2020-05-12 19:43:04 +03:00
parent 3cdd4963ff
commit 9921479c46

View file

@ -66,7 +66,7 @@
(respond (handle request)))))) (respond (handle request))))))
(def default-options-endpoint (def default-options-endpoint
{:no-doc true {:no-doc true
:handler default-options-handler}) :handler default-options-handler})
;; ;;
@ -82,7 +82,7 @@
| ----------------------------------------|------------- | ----------------------------------------|-------------
| `:reitit.middleware/transform` | Function or vector of functions of type `[Middleware] => [Middleware]` to transform the expanded Middleware (default: identity) | `:reitit.middleware/transform` | Function or vector of functions of type `[Middleware] => [Middleware]` to transform the expanded Middleware (default: identity)
| `:reitit.middleware/registry` | Map of `keyword => IntoMiddleware` to replace keyword references into Middleware | `:reitit.middleware/registry` | Map of `keyword => IntoMiddleware` to replace keyword references into Middleware
| `:reitit.ring/default-options-endpoint` | Default resource for `:options` method in endpoints (default: default-options-endpoint) | `:reitit.ring/default-options-endpoint` | Default endpoint for `:options` method in endpoints (default: default-options-endpoint)
Example: Example:
@ -100,9 +100,8 @@
::default-options-endpoint default-options-endpoint} ::default-options-endpoint default-options-endpoint}
opts)] opts)]
(assert (not (contains? opts ::default-options-handler)) (assert (not (contains? opts ::default-options-handler))
(str (str "Option `" ::default-options-handler "` is deprecated."
"Option `:reitit.ring/default-options-handler` is deprecated." " Use `:" ::default-options-endpoint "` instead."))
" Use `:reitit.ring/default-options-endpoint` instead."))
(r/router data opts)))) (r/router data opts))))
(defn routes (defn routes