Fork me on GitHub
#reitit
<
2018-11-28
>
lambdam17:11:10

@mkvlr yes I do something similar. I join the name and the language into the route name like so :home#fr. I can then disjoin both information when I need it. I don't know if it's ugly but until now, I didn't bump into any problem.

ro618:11:15

Is there a way to wrap a subset of routes with the same middleware? So far I see per-route middleware and global (configured via (ring/router))...

ikitommi18:11:40

@robert.mather.rmm you can use the nested route-syntax to wrap set of routes. The nesting segment can be empty too, works like reagent :<>

ikitommi18:11:19

["/api" {:middleware [api-mw]}
 ["/ping" ping]
 ["/pong" pong]]

ikitommi18:11:21

or:

["" {:middleware [shared-mw]}
 ["/ping" ping]
 ["/pong" pong]]

ikitommi18:11:02

the paths are concatenated, so "" doesn't add anything to the path, just extra route-data. Hope this helps.