org.vertx.scala.router

Router

trait Router extends (HttpServerRequest) ⇒ Unit

The Router trait can be extended to give access to an easy way to write nice routes for your HTTP server.

Self Type
Router with VertxAccess
Linear Supertypes
(HttpServerRequest) ⇒ Unit, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Router
  2. Function1
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Routing = PartialFunction[RouteMatch, Reply]

Abstract Value Members

  1. abstract def routes(implicit req: HttpServerRequest): (Router.this)#Routing

    Override this method to define your routes for the request handler.

    Override this method to define your routes for the request handler.

    req

    The HttpServerRequest that came in.

    returns

    A partial function that matches all routes.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (Unit) ⇒ A): (HttpServerRequest) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. final def apply(req: HttpServerRequest): Unit

    To be able to use this in HttpServer.requestHandler(), the Router needs to be a HttpServerRequest => Unit.

    To be able to use this in HttpServer.requestHandler(), the Router needs to be a HttpServerRequest => Unit. This apply method starts the magic to be able to use override def request() = ... for the routes.

    req

    The HttpServerRequest that comes in.

    Definition Classes
    Router → Function1
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. final def authed(replyIfAuthed: ⇒ Reply)(implicit req: HttpServerRequest): Reply

    Use this to check for authentication in your routes.

    Use this to check for authentication in your routes.

    replyIfAuthed

    The reply to send if the request is successfully authed.

    req

    The HttpServerRequest that was sent.

    returns

    The given replyIfAuthed or an Error reply that the request wasn't authed.

    Attributes
    protected
  8. def checkAuthentication(req: HttpServerRequest): Future[Boolean]

    Override this method for your custom authentication check.

    Override this method for your custom authentication check.

    req

    The HttpServerRequest to check.

    returns

    A future telling whether the request is authorized (true) or not (false / Exception).

    Attributes
    protected
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def compose[A](g: (A) ⇒ HttpServerRequest): (A) ⇒ Unit

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def notFoundFile: String

    File to send if the given file in SendFile was not found.

    File to send if the given file in SendFile was not found.

    Attributes
    protected
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def workingDirectory: String

    The working directory

    The working directory

    Attributes
    protected

Inherited from (HttpServerRequest) ⇒ Unit

Inherited from AnyRef

Inherited from Any

Ungrouped