This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-13
Channels
- # announcements (2)
- # beginners (15)
- # calva (6)
- # cider (3)
- # cljsrn (1)
- # clojure (33)
- # clojure-hk (4)
- # clojure-uk (9)
- # clojurescript (13)
- # cursive (5)
- # datomic (6)
- # figwheel-main (1)
- # fulcro (5)
- # graalvm (12)
- # instaparse (1)
- # kaocha (1)
- # nrepl (6)
- # off-topic (5)
- # pedestal (10)
- # quil (8)
- # reitit (2)
- # ring (5)
- # shadow-cljs (10)
- # sql (1)
- # vim (13)
Hey Folks, I am facing an issue with pedestal routing in little project. My routing work fine with this:
(def routes
#{["/" :get (conj common-interceptors `home-page)]
["/locals" :post (conj common-interceptors `upsert-local!)]
["/locals/:id" :get (conj common-interceptors `find-one-local!)]})
But when I add one more route to the map, this get broken:
(def routes
#{["/" :get (conj common-interceptors `home-page)]
["/locals" :post (conj common-interceptors `upsert-local!)]
["/locals/:id" :get (conj common-interceptors `find-one-local!)]
["/locals" :get (conj common-interceptors `find-map-local!)]})
Got this error:
INFO io.pedestal.http - {:msg "GET /", :line 80}
INFO io.pedestal.http.cors - {:msg "cors request processing", :origin "", :allowed true, :line 84}
ERROR i.p.http.impl.servlet-interceptor - {:msg "Dev interceptor caught an exception; Forwarding it as the response.", :line 314}
clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo in Interceptor :io.pedestal.http.route/router - You're trying to use something as an interceptor that isn't supported by the protocol; Perhaps you need to extend it?
Here is the test I am running:
(fact "hitting home page endpoint"
(GET "/" 200) => (match {:body {:msg "Hello World!"}}))
You're using a SET #{} of vectors #{ [] [] [] [] } but in a SET every vector must be unique... is that the issue
actually it may just be the sequence.
sometimes with COMPOJURE routing I have to adjust the order of things in the list.
because it does matching sequentially
yeah find-map-local must be broken