5

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?

hurshagrawal
  • 663
  • 6
  • 15

1 Answers1

5

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.

hurshagrawal
  • 663
  • 6
  • 15