This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-29
Channels
- # announcements (1)
- # babashka (83)
- # beginners (67)
- # chlorine-clover (22)
- # cider (11)
- # circleci (6)
- # clj-kondo (12)
- # cljs-dev (137)
- # cljsrn (15)
- # clojure (124)
- # clojure-europe (40)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-serbia (3)
- # clojure-spec (19)
- # clojure-uk (14)
- # clojuredesign-podcast (5)
- # clojurescript (80)
- # conjure (49)
- # core-async (62)
- # cursive (18)
- # datascript (1)
- # datomic (64)
- # docker (28)
- # emacs (20)
- # figwheel-main (249)
- # fulcro (95)
- # graalvm (2)
- # jobs-discuss (11)
- # joker (2)
- # juxt (4)
- # lambdaisland (9)
- # leiningen (1)
- # meander (14)
- # mount (6)
- # off-topic (16)
- # pathom (46)
- # re-frame (35)
- # reagent (6)
- # reitit (5)
- # shadow-cljs (28)
- # spacemacs (6)
- # sql (18)
- # tools-deps (26)
- # vim (8)
- # xtdb (23)
- # yada (1)
hello, all. i am learning to use reitit and want to build routes for a restfull service. i thought that something like:
["/api/resources"
{:get {...}
:put {...}}
["/:res-id"
{:get {...}
:patch {...}}]]
would generate 4 routes: GET/PUT /api/resources and GET/PATCH /api/resources/:res-id but found out that this is not the case, only the two last routes are generated. what is the proper way to create the 4 routes? should i flatten the routes myself or is there another way to build these hierarchical routes?@matheus.emm the intermediate path fragments are not counted as endpoints. There is a PR ongoing to change that. Before it, you need to define the endpoints like this:
["/api/resources"
[""
{:get {...}
:put {...}}
["/:res-id"
{:get {...}
:patch {...}}]]
@ikitommi, ok, understood. Maybe the documentation could be updated to make this point more obvious. When I read about this "empty" path I thought it was only to apply common data to a set of routes. Thanks for the clarification!
sure 🙂