This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-17
Channels
- # announcements (2)
- # aws (44)
- # beginners (96)
- # calva (10)
- # cider (7)
- # cljdoc (5)
- # cljsrn (2)
- # clojure (38)
- # clojure-dev (19)
- # clojure-europe (6)
- # clojure-italy (16)
- # clojure-nl (10)
- # clojure-norway (44)
- # clojure-spec (7)
- # clojure-uk (74)
- # clojurescript (133)
- # cloverage (1)
- # cursive (54)
- # datomic (78)
- # duct (11)
- # graalvm (5)
- # instaparse (4)
- # joker (3)
- # kaocha (5)
- # nrepl (2)
- # off-topic (10)
- # pathom (56)
- # pedestal (1)
- # reagent (7)
- # reitit (17)
- # shadow-cljs (144)
- # slack-help (2)
- # sql (35)
- # testing (5)
- # tools-deps (22)
- # vim (22)
- # xtdb (11)
Hi there.. I have a noob question about wiring up middleware in a duct app. Any chance this is the right place to ask? I want to wrap every request with this flash middleware: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/flash.clj. I thought adding it like this would do (in my base config):
:duct.handler/root {:middleware [
;; other middlewares...
#ig/ref :my.flash.middleware
]}
where :my.flash.middleware
is just this:
(defmethod ig/init-key :my.flash.middleware/flash [_ _]
#(rf/wrap-flash %))
.. but it doesn't work. Manually wrapping handlers with wrap-flash
appears to work, but I'm struggling to get it wired up for every request.I remember something about the a namespace named middleware
being treated specially, so this may not be the right answer. Have you tried referring to the whole key like #ig/ref :my.flash.middleware/flash
? (I believe that would also have to be a top level key like :my.flash.middleware/flash {}
)
Hmm no luck.. I'm wondering if some other middleware is interfering, maybe clobbering the session or something.
you might be in println debugging territory. or can you set a breakpoint? If so you could make a defn just for the purpose of setting a breakpoint.
Hmm boo. Will head down that path. But yeah I should be able to run the site with breakpoints.