Skip to content

Instantly share code, notes, and snippets.

@aktau
Created July 6, 2012 12:27
Show Gist options
  • Save aktau/3059891 to your computer and use it in GitHub Desktop.
Save aktau/3059891 to your computer and use it in GitHub Desktop.
scalatra slow path
def application(req: HttpRequest): Option[ScalatraApp] = {
logger.debug("The registered applications:")
logger.debug("%s" format applications)
application(req.uri.getPath) map (_.mounted) flatMap {
case f: ScalatraApp if f.hasMatchingRoute(req) => {
logger.debug("We found an App")
Some(f)
}
case f: ScalatraApp => {
logger.debug("We found an App, But no matching route")
Some(f)
}
case _ => {
logger.debug("No matching route")
None
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment