This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-11
Channels
- # beginners (104)
- # boot (14)
- # cider (10)
- # clojure (38)
- # clojure-australia (3)
- # clojure-dev (11)
- # clojure-spec (8)
- # clojurebridge (2)
- # clojurescript (50)
- # core-async (118)
- # emacs (3)
- # expound (2)
- # fulcro (39)
- # jobs (3)
- # jobs-discuss (17)
- # kaocha (2)
- # lumo (1)
- # off-topic (16)
- # onyx (1)
- # re-frame (1)
- # reitit (24)
- # shadow-cljs (14)
- # sydney (1)
- # tools-deps (14)
- # yada (1)
^:-- inspecting interceptor steps via deep-diff transformer function (`:enter`, :leave
and :error
).
to get the diffs:
• [metosin/reitit "0.2.8-SNAPSHOT"]
• with middleware, add a router option :reitit.middleware/transform reitit.ring.middleware.dev/print-request-diffs
• with interceptors, add a router option :reitit.interceptor/transform reitit.http.interceptors.dev/print-context-diffs
@shaun-mahood if you have ideas & time, improvements most welcome for the diffs.
@ikitommi Looks great, I should get a chance to play with it this week!
Hey. I'm trying to implement a the following route:
[["/v1"
["/" {:get {:handler (fn [req] {:body {:hello ["from /v1"]}})}}]]
["/*" {:get {:handler (fn [req] {:body {:hello ["from anything else"]}})}}]]
@phil you have a route conflict:
CompilerException clojure.lang.ExceptionInfo: Router contains conflicting route paths:
/v1/
-> /*
you can resolve that by disabling the conflict resolution, see https://metosin.github.io/reitit/basics/route_conflicts.html
(def r
(r/router
[["/v1"
["/" {:get {:handler (fn [req] {:body {:hello ["from /v1"]}})}}]]
["/*" {:get {:handler (fn [req] {:body {:hello ["from anything else"]}})}}]]
{:conflicts nil}))
(r/match-by-path r "/kikka")
;#reitit.core.Match{:template "/*",
; :data {:get {:handler #object[reitit.http.interceptors.dev$fn__27957
; 0x6814e716
; "reitit.http.interceptors.dev$fn__27957@6814e716"]}},
; :result nil,
; :path-params {: "kikka"},
; :path "/kikka"}