This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-10
Channels
- # announcements (9)
- # babashka (19)
- # beginners (39)
- # calva (7)
- # cherry (1)
- # cider (2)
- # clojure (31)
- # clojure-europe (8)
- # clojure-norway (9)
- # datalevin (10)
- # events (2)
- # fulcro (10)
- # hyperfiddle (9)
- # joker (1)
- # lsp (50)
- # membrane (34)
- # minecraft (2)
- # missionary (21)
- # off-topic (17)
- # pedestal (1)
- # polylith (8)
- # reitit (3)
- # sql (4)
- # squint (16)
- # xtdb (14)
this might sound noobish, but is there a way to build web paths in a "portable" way ?
Right now I use str
but I noticed it failed when I added (ring/redirect-trailing-slash-handler)
.
This is because I had "/clicked" and after rediect-handler I had "//clicked" .
(defn home [request]
(let [{:keys [uri]} request
clicked-path (str uri "clicked")]
(page
[:body
[:h1 "Welcome to Htmx + Kit module"]
[:button {:hx-post clicked-path :hx-swap "outerHTML"} "Click me!"]])))
Is there an utility that can build paths from parts like for filesystem e.g. https://babashka.org/fs/API.html#path ?it feels like it's overkill but there's https://github.com/lambdaisland/uri