This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-17
Channels
- # announcements (2)
- # asami (3)
- # babashka (30)
- # beginners (23)
- # calva (28)
- # cider (3)
- # clj-kondo (16)
- # clj-on-windows (7)
- # cljs-dev (7)
- # clojure (47)
- # clojure-austin (3)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-nl (1)
- # clojure-uk (3)
- # clojurescript (54)
- # community-development (24)
- # conjure (16)
- # duct (1)
- # emacs (8)
- # events (1)
- # figwheel-main (4)
- # fulcro (13)
- # gratitude (20)
- # helix (3)
- # honeysql (8)
- # hyperfiddle (12)
- # introduce-yourself (1)
- # jobs (6)
- # lambdaisland (1)
- # lsp (35)
- # malli (1)
- # meander (27)
- # minecraft (11)
- # off-topic (12)
- # pathom (1)
- # portal (11)
- # releases (1)
- # remote-jobs (1)
- # ring (11)
- # sci (1)
- # shadow-cljs (53)
- # specter (5)
- # xtdb (20)
Hello all! I’m trying to leverage ^:replace
to disable some of the default middleware included with duct.module.web/api
, but can’t seem to make it work. A simplified version of my config.edn
is as follows:
{:duct.profile/base
{:duct.handler/root
{:middleware ^{:replace true} [#ig/ref :duct.middleware.web/not-found
#ig/ref :duct.middleware.web/format
#ig/ref :duct.middleware.web/defaults]}
:duct.router/ataraxy
{:routes
{[:get "/status"] [:my.handlers/status]}}}
:duct.profile/dev #duct/include "dev"
:duct.profile/local #duct/include "local"
:duct.profile/prod {}
:duct.module/logging {}
:duct.module.web/api {}}
and the general idea is to disable the :duct.middleware.web/log-requests
middleware that the web module brings in. I’m using [duct/core "0.7.0"]
and [duct/module.web "0.7.0"]
. In the repl when I try
(duct.core.merge/meta-merge ^{:replace true} [{:key :duct.middleware.web/not-found}
{:key :duct.middleware.web/format}
{:key :duct.middleware.web/defaults}]
[{:key :duct.middleware.web/log-requests}
{:key :duct.middleware.web/log-errors}])
I get
[{:key :duct.middleware.web/not-found}
{:key :duct.middleware.web/format}
{:key :duct.middleware.web/defaults}]
if that makes any sense. Could it be that the :replace
metadata gets lost somehow?