case class NaptimePlayRouter(naptimeRoutes: NaptimeRoutes, prefix: String) extends play.api.routing.Router with StrictLogging with Product with Serializable
Handles routing for Naptime resources in an idiomatic fashion for Play projects.
To use this router, include in your routes file something like:
# Include Naptime resources -> /api org.coursera.naptime.router2.PlayNaptimeRouter
Requests matching the prefix for naptime resources will then be routed appropriately.
- naptimeRoutes
Collects the common data structures useful for request routing, including the router builders, as well as the routers themselves.
- prefix
The prefix path under which the resources should be served (in the example above:
/api).
- Annotations
- @Singleton()
- Alphabetic
- By Inheritance
- NaptimePlayRouter
- Serializable
- Serializable
- Product
- Equals
- StrictLogging
- Router
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
NaptimePlayRouter(naptimeRoutes: NaptimeRoutes)
- Annotations
- @Inject()
-
new
NaptimePlayRouter(naptimeRoutes: NaptimeRoutes, prefix: String)
- naptimeRoutes
Collects the common data structures useful for request routing, including the router builders, as well as the routers themselves.
- prefix
The prefix path under which the resources should be served (in the example above:
/api).
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
/:(prefix: String): play.api.routing.Router
- Definition Classes
- Router
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asJava: play.routing.Router
- Definition Classes
- Router
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
lazy val
documentation: Seq[(String, String, String)]
Includes the Naptime resources into Play's dev mode not-found handler that lists all routes.
Includes the Naptime resources into Play's dev mode not-found handler that lists all routes.
- Definition Classes
- NaptimePlayRouter → Router
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
handlerFor(request: RequestHeader): Option[Handler]
- Definition Classes
- Router
-
def
handlerForImpl(request: RequestHeader): Option[Handler]
Route the request to one of the naptime resources, invoking the (macro-generated) router.
Route the request to one of the naptime resources, invoking the (macro-generated) router.
- request
The request to route.
- returns
If this is a naptime request for one of the routers, return the handler, otherwise None
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
logger: Logger
- Attributes
- protected
- Definition Classes
- StrictLogging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
orElse(other: play.api.routing.Router): play.api.routing.Router
- Definition Classes
- Router
-
lazy val
routes: Routes
Defer to handlerFor instead of the other way around for performance reasons.
Defer to handlerFor instead of the other way around for performance reasons.
It is better to have the true implementation in
handlerForwhere we can route a request once than to implement the partial function here, and have handlerFor call isDefinedAt and then apply, which would result in request routing and URL parsing occuring twice for a single request when it wouldn't need to.- Definition Classes
- NaptimePlayRouter → Router
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withPrefix(prefix: String): play.api.routing.Router
- Definition Classes
- NaptimePlayRouter → Router