Skip to content

Instantly share code, notes, and snippets.

@oitee
Last active October 20, 2022 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oitee/00a6153e7ec90425a029516b73480523 to your computer and use it in GitHub Desktop.
Save oitee/00a6153e7ec90425a029516b73480523 to your computer and use it in GitHub Desktop.
(require '[ring.middleware.params :as rmp]
'[ring.middleware.keyword-params :as rmkp])
(defn handler-that-needs-keyword-params
[{params :params}]
(ring.util.response/response "Hello" (:name params) " your ID is: " (:id params)))
(rmp/wrap-params
(rmkp/wrap-keyword-params handler-that-needs-keyword-params))
;; => new handler function with the combined functionality of
;; wrap-params and wrap-keyword-params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment