Fork me on GitHub
#reitit
<
2021-05-20
>
Dave Russell07:05:59

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! šŸ™‚

eskos16:05:32

def -> defn and use component/mount to bind the produced router to lifecycle -> app reload regenerates the routes and result is cached šŸ™‚

eskos16:05:12

(and you can run multiple instances of your routes at the same time as well, which usually might be a bug though)

Michaƫl Salihi09:05:29

Hi, is it a way to extract all routes like Bidi does with route-seq ? https://github.com/juxt/bidi#route-sequences

Michaƫl Salihi09:05:49

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

Michaƫl Salihi09:05:50

The objective being to expose routes + a helper in order to do reverse routing on the client side.

Johan09:05:56

Might not be related to reitit but anyone know how to disable jetty logging, or at least remove the debug information. Thanks.

Johan10:05:48

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