This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-23
Channels
- # announcements (1)
- # architecture (20)
- # babashka (30)
- # beginners (79)
- # calva (27)
- # cider (8)
- # clj-kondo (1)
- # clojure (125)
- # clojure-australia (1)
- # clojure-berlin (4)
- # clojure-europe (62)
- # clojure-france (1)
- # clojure-italy (6)
- # clojure-nl (4)
- # clojure-uk (12)
- # clojuredesign-podcast (5)
- # clojurescript (28)
- # core-async (31)
- # cursive (14)
- # datomic (47)
- # defnpodcast (1)
- # emacs (7)
- # figwheel-main (2)
- # fulcro (10)
- # graalvm (1)
- # graphql (11)
- # jobs-discuss (8)
- # leiningen (2)
- # off-topic (23)
- # rdf (9)
- # re-frame (3)
- # reagent (1)
- # reitit (5)
- # reveal (12)
- # shadow-cljs (12)
- # spacemacs (1)
- # tools-deps (87)
- # vim (22)
- # xtdb (21)
Hey folks! Apologies if this has been asked before -- I'm investigating what it would take to port a large compojure
app over to reitit
. Is there a recommended transition process? Is it possible to move one route at a time? Any pointers would be much appreciated 🙂
I did that migration a while ago, as I recall it was pretty straightforward. The main gotcha is to be aware that compojure middleware runs “upside-down,” i.e. the the last middleware in the list will be the first to process your incoming request, etc, where as reitit middleware runs from top to bottom: first in the list will be the first to process requests. Also, if you require [reitit.ring.middleware.dev :as reitit-dev]
, and set :reitit.middleware/transform reitit-dev/print-request-diffs
in your ring/router options, you’ll get a ton of diagnostic in the REPL that’s very helpful in debugging middleware issues. I keep them in as comments so I can uncomment them any time I need to debug.
Appreciate the response and tips! I think the request-diffs
will be very helpful 🙂 I have been playing around and successfully converted a single API endpoint with all our middlewares to reitit
, which I think will make this migration very tractable. If we end up going down this path I think I'll do a write-up!