This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-29
Channels
- # ai (2)
- # beginners (12)
- # bitcoin (1)
- # boot (41)
- # chestnut (5)
- # cider (9)
- # clara (24)
- # cljs-dev (11)
- # clojure (107)
- # clojure-dev (2)
- # clojure-italy (4)
- # clojure-nl (4)
- # clojure-russia (10)
- # clojure-spec (19)
- # clojure-uk (71)
- # clojurescript (121)
- # cursive (3)
- # data-science (7)
- # datacrypt (1)
- # datomic (72)
- # docs (7)
- # duct (2)
- # emacs (3)
- # ethereum (1)
- # figwheel (1)
- # fulcro (58)
- # graphql (16)
- # hoplon (9)
- # jobs (2)
- # jobs-rus (1)
- # lein-figwheel (1)
- # leiningen (25)
- # luminus (2)
- # lumo (5)
- # off-topic (6)
- # onyx (22)
- # pedestal (3)
- # portkey (1)
- # proton (2)
- # re-frame (7)
- # remote-jobs (1)
- # ring-swagger (3)
- # rum (2)
- # shadow-cljs (38)
- # specter (7)
- # yada (30)
Hey, quick one but I feel like I'm missing something terribly obvious: I'm defining routes using table syntax, but I'm a pickle trying to make Pedestal find out route names by the handlers. A simple sample is:
(defn current-version
[{{config :config} :components}]
{:status 200 :body {:version (config/version config)}})
...
["/api/version" :get (conj public-interceptors current-version)]
Above code breaks that the last interceptor had no name and there is no explicit :route-name
.
What could be done differently on the handler function to allow Pedestal to infer the route name? I was under the impression that it used the symbol's name but that doesn't seem to be the case.Got it: I gotta provide the handler fn as a symbol (with a backquote), then it works.
["/api/version" :get (conj public-interceptors `current-version)]