This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-21
Channels
- # announcements (1)
- # babashka (13)
- # beginners (85)
- # calva (1)
- # chlorine-clover (16)
- # cider (30)
- # clj-kondo (2)
- # clj-on-windows (5)
- # cljdoc (3)
- # cljs-dev (12)
- # cljsrn (19)
- # clojure (88)
- # clojure-europe (39)
- # clojure-nl (7)
- # clojure-sweden (3)
- # clojure-uk (8)
- # clojurescript (35)
- # core-async (3)
- # data-science (2)
- # datomic (17)
- # defnpodcast (3)
- # deps-new (1)
- # editors (18)
- # emacs (4)
- # events (1)
- # expound (1)
- # figwheel-main (8)
- # fulcro (9)
- # graalvm (2)
- # graalvm-mobile (11)
- # helix (44)
- # jobs (7)
- # lsp (95)
- # luminus (9)
- # malli (6)
- # meander (4)
- # membrane (2)
- # missionary (13)
- # off-topic (98)
- # pathom (2)
- # polylith (4)
- # portal (3)
- # re-frame (6)
- # reagent (27)
- # reitit (3)
- # releases (3)
- # remote-jobs (6)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (7)
- # sql (66)
- # tools-deps (80)
- # vim (5)
- # xtdb (3)
Is there a simple way to add a camelCase -> kebab-case middleware into luminus for my POST requests? Right now I have something like this:
(def instance
(m/create
(-> m/default-options
(update-in
[:formats "application/transit+json" :decoder-opts]
(partial merge time/time-deserialization-handlers))
(update-in
[:formats "application/transit+json" :encoder-opts]
(partial merge time/time-serialization-handlers))
(update-in
[:formats "application/json" :encoder-opts]
(partial merge #(name (csk/->camelCase %))))
(update-in
[:formats "application/json" :decoder-opts]
(partial merge #(keyword (csk/->kebab-case %)))))))
But it's obviously not working.I almost had it! I didn't add the anonymous function to the right key.
(def instance
(m/create
(-> m/default-options
(update-in
[:formats "application/transit+json" :decoder-opts]
(partial merge time/time-deserialization-handlers))
(update-in
[:formats "application/transit+json" :encoder-opts]
(partial merge time/time-serialization-handlers))
(update-in
[:formats "application/json" :encoder-opts]
(partial merge {:encode-key-fn #(name (csk/->camelCase %))}))
(update-in
[:formats "application/json" :decoder-opts]
(partial merge {:decode-key-fn #(keyword (csk/->kebab-case %))})))))
Created new luminus fullstack app, however the shadow-cljs watch app command shows up an error, Any ideas?
What error do you get? Which command exactly did you type?
shadow-cljs watch app, it says cannot bind to port 9630, actually nothing is running on that port
however shadow-cljs compile app runs, so it is a issue with port, where do we set another port?
Is the backend working (port 3000)? Just to check that the process is allowed to open ports at all
this was created using lein new luminus +re-frame +http-kit
Issue with lein script, updated to 2.9.6 and things started working