Fork me on GitHub
#reitit
<
2023-03-05
>
dgb2314:03:24

I want to generate routes at runtime like in this example (beer routes): https://cljdoc.org/d/metosin/reitit/0.6.0/doc/advanced/composing-routers#when-to-use-nested-routers Are the following assumptions correct? • If I want to do this with ring handler that I directly pass to jetty or aleph, then I would have to restart the server • In order to achieve it I would need to write a ring handler that dereferences the generated handler or router (?) that I can then call pass the request. Apparently there is a todo at the end of the docs that mentions this. So I assume this is a very common case. If I my assumptions are correct or I find a better answer then I wouldn't mind to contribute a section in the docs!

ikitommi15:03:28

Correct, I think it's a common case, have used that pattern myself. We just added a reloading-ring-handler into reitit.ring, which can be used to build the example. Example/docs most welcome on this!

🙏 2
dgb2323:03:31

Thank you! Ill try it out soon!

dgb2323:03:14

It worked nicely so far! Ty for the suggestion. I proposed a small example to the docs.