Fork me on GitHub
#ring
<
2017-10-06
>
chadhs14:10:44

what’s the best practice for combining routes from multiple namespaces in a ring app using compojure?

chadhs14:10:13

for example if you had a lists and items namespace with a route.clj using the defroutes macro

chadhs14:10:39

is there a common pattern for bringing all those routes together in your app’s core.clj or perhaps a top level route.clj?

chadhs14:10:39

@mgrbyte thanks, i’ll take a look at this 👍

chadhs14:10:47

@mgrbyte so you’re essentially just storing all the routes (defined via defroutees) from each namespace in a vector called all-routes yes?

chadhs14:10:18

don’t you need to combine/merge these then?

mgrbyte14:10:03

@chadhs yes, ☝️ all-routes flattened, then given to compojure.api.sweet/routes

chadhs14:10:51

nice! i was thinking about something like this, but didn’t know if it was idiomatic.

chadhs14:10:01

seems reasonable to me either way thanks for your help @mgrbyte