Created
July 6, 2012 12:27
-
-
Save aktau/3059891 to your computer and use it in GitHub Desktop.
scalatra slow path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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