This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-16
Channels
- # announcements (1)
- # aws (1)
- # babashka (14)
- # beginners (25)
- # biff (5)
- # calva (6)
- # clj-kondo (3)
- # cljsrn (7)
- # clojars (7)
- # clojure (26)
- # clojure-europe (13)
- # clojurescript (10)
- # code-reviews (1)
- # cursive (9)
- # datahike (3)
- # datomic (7)
- # depstar (5)
- # emacs (9)
- # garden (2)
- # graalvm (1)
- # helix (3)
- # jobs (1)
- # leiningen (2)
- # off-topic (1)
- # pathom (3)
- # re-frame (16)
- # reitit (3)
- # releases (1)
- # shadow-cljs (10)
- # spacemacs (6)
- # tools-deps (16)
Hi. I'm wondering if it's possible to have both GET and POST for the same route with reitit? When I try the following I get an error
Sure, you just have to nest it instead of listing it as a series of empty routes:
{"/polls"
{:middleware [middleware/wrap-csrf middleware/wrap-formats]
:name "Polls"
:get {:handler #'my/get-handler}
:post {:handler #'my/post-handler}}
Caveat: that’s my early morning, pre-coffee, top-of-my-head code, I think it’s correct but no guarantees. That’s the general idea tho.