This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-22
Channels
- # 100-days-of-code (1)
- # adventofcode (21)
- # announcements (2)
- # beginners (44)
- # calva (1)
- # cider (2)
- # cljdoc (16)
- # cljs-dev (70)
- # cljsrn (29)
- # clojure (66)
- # clojure-austria (1)
- # clojure-europe (4)
- # clojure-finland (1)
- # clojure-hamburg (1)
- # clojure-italy (24)
- # clojure-nl (3)
- # clojure-uk (127)
- # clojurescript (30)
- # core-typed (3)
- # cursive (34)
- # data-science (2)
- # datomic (16)
- # duct (17)
- # editors (1)
- # emacs (4)
- # figwheel-main (4)
- # fulcro (40)
- # hoplon (2)
- # instaparse (5)
- # kaocha (4)
- # leiningen (1)
- # luminus (4)
- # nrepl (46)
- # off-topic (5)
- # onyx (2)
- # other-languages (55)
- # parinfer (3)
- # protorepl (4)
- # re-frame (33)
- # reagent (6)
- # reitit (13)
- # ring-swagger (5)
- # shadow-cljs (26)
- # spacemacs (4)
- # sql (8)
- # testing (27)
- # tools-deps (21)
- # yada (1)
Hej, just discovered reitit and play a little around with it. How can I define optional parameters, like for path users/:id
yes I want to get alle users or a specific user
another option to use flattened routes:
[["/users" ::users/index]
["/users/:id" ::users/show]]
… both compile to identical internal routing tree, so identical perf etc.And when I use
["/users"
{:get {:summary "get users"
:parameters {:id}}}]
that'd be
["/users"
["/:id" {:get {:parameters {:path {:id int?}}
:handler users-show}}]]
like this👍 4
::users/index
is the function index in ns users?
["/users" ::users/index]
expands to ["/users" {:name ::users/index}]
, which is usually good enough in the frontend.