This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-29
Channels
- # aws (8)
- # babashka (45)
- # beginners (83)
- # cider (23)
- # clj-on-windows (4)
- # cljdoc (23)
- # clojars (6)
- # clojure (68)
- # clojure-dev (33)
- # clojure-europe (75)
- # clojure-nl (1)
- # clojure-uk (4)
- # clojurescript (14)
- # conjure (6)
- # data-science (15)
- # datascript (7)
- # datomic (47)
- # docker (15)
- # events (1)
- # fulcro (4)
- # graphql (3)
- # jobs (4)
- # lsp (14)
- # nginx (2)
- # nrepl (2)
- # off-topic (41)
- # pathom (18)
- # pedestal (1)
- # polylith (72)
- # reitit (8)
- # reveal (1)
- # shadow-cljs (48)
- # tools-build (11)
- # tools-deps (24)
- # xtdb (8)
I feel this is a stupid question, but is there a straightforwards way of using a middleware (request logging in this case) only on a reitit subpath? Or disabling it on a specific subpath?
We don't want to log healthcheck requests/responses but do want it on our API routes - but the logging middleware is in the middle of the ring middleware stack so I'm not sure of the best way of doing this while still using {:data {:middleware}}
as a second arg to ring-router
We're coming from compojure so the logging middleware is currently unaware of reitit
I just got this to work by creating a function which returns middleware with options and called that on the two subpaths (`/internal` and /api
) with logging: true/false
respectively.
That means I had to remove the default middleware on the router though, I'd prefer it if there was a way to mutate things but I guess this works - I was wondering on the most ideomatic way
but it needs to be called in a specific order in the middleware vector, am I missing a simple solution to set that up? My assumption is that if I just add it there, it'll be last in the chain