Question for you folks! We have a large number of routes that are distributed across many namespaces, so we have a top-level server namespace with, for example, one "subtree" router:
(ring/router
["/subtree" (r/routes subtree-router)])
Along with another ring router for the subtree (in another namespace):
(def subtree-router
(ring/router
["" {:get {:handler .... }}]))
The reason we have multiple routers is because we have a number of helper functions that "think" in terms of routers (e.g. merging routers, selecting routes, filtering routers, etc). However, the primary issue with this is that we have to reload multiple namespaces for any route updates because the "top level" router doesn't automatically pick up changes in it "subtree" routers given how router creation works. Has anyone had similar experiences? Should we give up on multiple routers? Thanks! 🙂Hi, is it a way to extract all routes like Bidi does with route-seq
?
https://github.com/juxt/bidi#route-sequences
Or even better, a Clojure solution getting closer to what is done in: • PHP with https://github.com/tighten/ziggy • Ruby on Rails with https://github.com/railsware/js-routes
The objective being to expose routes + a helper in order to do reverse routing on the client side.
That a good start but limited to CLJS front end I guess. https://cljdoc.org/d/metosin/reitit/0.5.13/doc/advanced/shared-routes
Might not be related to reitit but anyone know how to disable jetty logging, or at least remove the debug information. Thanks.
Found a solution, add a file named jetty-logging.properties
in resources folder with this line and it will not show the DEBUG in the repl.
org.eclipse.jetty.LEVEL=INFO
def
-> defn
and use component/mount to bind the produced router to lifecycle -> app reload regenerates the routes and result is cached 🙂
(and you can run multiple instances of your routes at the same time as well, which usually might be a bug though)