This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-09
Channels
- # announcements (5)
- # babashka (1)
- # beginners (116)
- # calva (139)
- # cider (11)
- # clara (2)
- # clj-kondo (13)
- # clojure (247)
- # clojure-dev (18)
- # clojure-europe (5)
- # clojure-france (2)
- # clojure-italy (2)
- # clojure-nl (7)
- # clojure-spec (24)
- # clojure-uk (34)
- # clojurescript (41)
- # cursive (11)
- # data-science (2)
- # datomic (33)
- # emacs (10)
- # events (3)
- # fulcro (134)
- # graphql (9)
- # jackdaw (3)
- # jobs (1)
- # joker (20)
- # kaocha (3)
- # leiningen (7)
- # luminus (2)
- # malli (3)
- # music (1)
- # pedestal (7)
- # re-frame (25)
- # remote-jobs (7)
- # ring (7)
- # shadow-cljs (85)
- # spacemacs (13)
- # testing (2)
- # tools-deps (60)
- # xtdb (11)
- # yada (7)
Hey, so I'm running into some behaviour that I can't quite explain. I have two routes defined in table syntax: #{["/foos/search" :get [..] :route-name :search] ["/foos/:foo-id/bar" :post [..] :route-name :bar]}
; the presence of the second route makes the system return a 404 for the first. This leads me to believe they are conflicting, but both the verbs and the route-names are different? I can't seem to explain this. We are on io.pedestal/pedestal.route {:mvn/version "0.5.3"}
.
@dadair it's by design: > The prefix-tree router also changes some of the routing behavior. In the linear-search, you could have routes like /one/:wild and /one/two, the latter being a hard match and the former picking up any wildcard URL matches (not /one/two). In the prefix-tree, this isn't allowed, and one/:wild will always be matched. This change also encourages "best practices" and removes the possibility of subtle bugs introduced by human error.
@dadair refer to http://pedestal.io/reference/using-the-builtin-routers. You’ll want to use the Linear Search router instead