Currently I define my app\'s javascript router in a fairly verbose way
def javascriptRoutes = Action { implicit request =>
import routes.javascript._
Ok(R
Very nice solution by thatsmydoing. If you have the JavaScript-routes under some other subpackage, you need to declare routeCache like this
val routeCache = {
val jsRoutesClass = classOf[controllers.api.routes.javascript]
val controllerArray = jsRoutesClass.getFields().map(_.get(null))
controllerArray.flatMap { controller =>
controller.getClass().getDeclaredMethods().map { action =>
action.invoke(controller).asInstanceOf[play.core.Router.JavascriptReverseRoute]
}
}
}