reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
benny 2020-09-24T22:38:25.001800Z

how do i get the current “request method” from middleware?

(defn foo-mw [handler]
  (fn [req]
    (prn (-> req (ring/get-match) :data))
    (handler req)))
the output is at the route level, not the request method level 😕

benny 2020-09-24T23:18:59.002200Z

found it thanks to the swagger middleware

(fn [{::r/keys [match] :keys [request-method] :as req}]
    (prn (-> match :result request-method :data :foo))

👍 1