This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-14
Channels
- # aleph (4)
- # announcements (10)
- # babashka (21)
- # beginners (67)
- # biff (7)
- # calva (4)
- # clojure (40)
- # clojure-europe (11)
- # clojure-gamedev (17)
- # clojure-losangeles (3)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (78)
- # clojure-uk (3)
- # clojurescript (83)
- # core-typed (18)
- # cursive (1)
- # datalevin (2)
- # datomic (2)
- # gratitude (2)
- # hyperfiddle (56)
- # introduce-yourself (1)
- # london-clojurians (1)
- # matcher-combinators (10)
- # membrane (161)
- # polylith (16)
- # portal (4)
- # reitit (4)
- # releases (3)
- # ring (2)
- # shadow-cljs (9)
- # squint (2)
- # timbre (10)
- # xtdb (14)
- # yamlscript (1)
I got caught up on doing this today: ((reitit.ring/ring-handler (http://reitit.co/router ["/testpath" (fn [_] {:status 200 :body "ok"})])) {:request-method :get :uri "/testpath"}) => nil The error here is to use reitit.ring/router instead of reitit.core/router. I think this is somewhat a usability problem (which could be unique for only me), but would it somehow be possible for reitit.ring/ring-handler to deduce that the given router won't work as expected? Or - maybe more interesting - what is really the difference between reitit.core/router and reitit.ring/router?
I checked my project and I am using reitit.ring/router
, which according to the documentation simply creates a reitit.core/Router
. So there shouldn’t be any difference?
I'm using reitit 0.7.0-alpha7 and there is some difference between the two router
functions there. In reitit.ring/router
there is a transform that puts all handler functions in a :handler
key for performance (which of course makes total sense). The strange thing was that I could not get it working even when I tried to be rigid about the structure of the handler fn.