Override this method to define your routes for the request handler.
Override this method to define your routes for the request handler.
The HttpServerRequest that came in.
A partial function that matches all routes.
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.
The HttpServerRequest that comes in.
Use this to check for authentication in your routes.
Use this to check for authentication in your routes.
The reply to send if the request is successfully authed.
The HttpServerRequest that was sent.
The given replyIfAuthed or an Error reply that the request wasn't authed.
Override this method for your custom authentication check.
Override this method for your custom authentication check.
The HttpServerRequest to check.
A future telling whether the request is authorized (true) or not (false / Exception).
File to send if the given file in SendFile was not found.
File to send if the given file in SendFile was not found.
The working directory
The working directory
The Router trait can be extended to give access to an easy way to write nice routes for your HTTP server.