Skip to content

Instantly share code, notes, and snippets.

@oitee
Last active October 12, 2022 06:22
Show Gist options
  • Save oitee/5d48406fd00613fbe55f9bfeccf1505b to your computer and use it in GitHub Desktop.
Save oitee/5d48406fd00613fbe55f9bfeccf1505b to your computer and use it in GitHub Desktop.
(defn middleware-fn
[handler-fn]
(fn [request]
;; operations on the request:
;; to create a `new-request`
;; or to simply log etc
(let [new-response (handler-fn new-request)]
;; operations on the `new-response`:
;; to create a `new-and-modified-response`
;; or to simply log etc
new-and-modified-response)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment