Question

what's the best way to route to one page if the user is signed in (i.e. session has a non-nil value for the user-id key) and another if the user is not signed in? The ideal would be 2 different set of routes.

Thanks!

Also, are there any good example apps using compojure out there?

Was it helpful?

Solution

Ok, so figured this out. Routes in compojure are composable, so you can take a defroutes handlers and feed it to another defroutes handler.

http://vedang.me/techlog/2015/8/21/composability-and-compojure has a great explanation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top