This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-17
Channels
- # announcements (2)
- # aws (7)
- # beginners (46)
- # cider (15)
- # clj-kondo (24)
- # cljs-dev (3)
- # clojure (46)
- # clojure-dev (34)
- # clojure-europe (7)
- # clojure-italy (7)
- # clojure-nl (10)
- # clojure-norway (15)
- # clojure-spec (5)
- # clojure-uk (42)
- # clojuredesign-podcast (1)
- # clojurescript (79)
- # clr (3)
- # core-async (1)
- # cursive (45)
- # data-science (1)
- # datomic (4)
- # fulcro (17)
- # funcool (14)
- # gorilla (2)
- # graphql (30)
- # jackdaw (5)
- # jobs-discuss (8)
- # joker (4)
- # lein-figwheel (1)
- # off-topic (48)
- # pedestal (26)
- # re-frame (36)
- # reagent (18)
- # reitit (6)
- # remote-jobs (4)
- # shadow-cljs (115)
- # tools-deps (62)
- # vim (12)
"/api" {:interceptors [http/transit-body] "/echo" {:get `api/echo} "/catalogues" {:get `[:catalogues api/get]} "/code-systems" {:get `[:code-systems api/get]} "/code-systems/formats" {:get `[:code-system-formats api/get]} "/code-systems/formats/:format" {:get `[:code-system-format api/get]} "/code-systems/:id" {:get `[:code-system-details api/get]} "/code-systems/:id/concepts" {:get `[:code-system-concepts api/get]} "/code-systems/:id/concepts/:id" {:get `[:code-system-concept-details api/get]}
Why does "/code-systems/formats/:format" {:get `[:code-system-format api/get]} return 404 ?
Reading from a phone, and lack of highlighting doesn’t help, but I don’t think you’re supposed to wrap :get [,,,]
in a map. I’m surprised you don’t get an error.
Hi @orestis and thanks for your response. I am new to pedestal and i can't find a way to make these routes working
(def routes #{"/" {:get pages/home} "/health" {:get `api/health} "/app" {:interceptors [http/html-body] "" {:get `pages/spa}} "/api" {:interceptors [http/transit-body] "/echo" {:get `api/echo} "/catalogues" {:get `[:catalogues api/get]} "/code-systems" {:get `[:code-systems api/get]} "/code-systems/formats" {:get `[:code-system-formats api/get]} "/code-systems/formats/ATC" {:get `[:code-system-format api/get]} "/code-systems/:id" {:constraints {:id #"[0-9]+"} :get `[:code-system-details api/get]} ; "/code-systems/:id/concepts" {:get `[:code-system-concepts api/get]} ; "/code-systems/:id/concepts/:id" {:get `[:code-system-concept-details api/get]} "/user" {:get `api/user}}})
(def service {;; do not block thread that starts web server ::http/join? false ::http/port port ::http/host "0.0.0.0" ::http/resource-path "/public" ::http/routes (route/expand-routes routes) ::http/enable-session {:cookie-name "SID" :store (cookie/cookie-store)} ::http/type :jetty ;; for dev only? ::http/secure-headers {:content-security-policy-settings {:object-src "none"}} ::http/container-options {:h2c? true :h2? false :ssl? false}})
(def routes [[["/" :get pages/home ["/app" {:get pages/spa} ^:interceptors [http/html-body]]]]])
Caused by: java.lang.IllegalArgumentException: No implementation of method: :expand-verb-action of protocol: #'io.pedestal.http.route.definition.terse/ExpandableVerbAction found for class: app.html_pages$spa
Even with this new routes, last route does not work (api/code-systems/formats/test1) -> 404 not found
http://pedestal.io/reference/routing-quick-reference - doesn’t seem to be a need to quote the vector as you do?
If i don't quote i haave error like Caused by: java.lang.IllegalArgumentException: No implementation of method: :expand-verb-action of protocol: #'io.pedestal.http.route.definition.terse/ExpandableVerbAction found for class: app.html_pages$spa