reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Dave Russell 2021-05-20T07:39:59.005900Z

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! 🙂

2021-05-20T09:17:29.007800Z

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

2021-05-20T09:29:49.008900Z

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

2021-05-20T09:31:50.009500Z

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

2021-05-20T09:34:09.010500Z

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

johan 2021-05-20T09:49:56.012100Z

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

johan 2021-05-20T10:20:48.012200Z

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

eskos 2021-05-20T16:49:32.013Z

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

eskos 2021-05-20T16:50:12.013200Z

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