RouteTable

io.eezo.http.RouteTable
See theRouteTable companion class
object RouteTable

Attributes

Companion
class
Source
Route.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
RouteTable.type

Members list

Value members

Concrete methods

def apply(routes: Seq[Route], identify: Request => Request = ...): RouteTable

A table over these routes, naming whoever identify names, and nobody when it is left out.

A table over these routes, naming whoever identify names, and nobody when it is left out.

The default is the one thing to be careful with, because it is silent. An application that rebuilds the generated table by hand, to mount half of it under a prefix or to reorder it, has the routes of a table that names the current user and is one argument away from a table that names nobody: RouteTable(table.routes) compiles, serves every page exactly as before, and turns every socket upgrade anonymous, with nothing in the request to say whether it was never named or honestly named nobody. A table built from another table's routes therefore passes that table's identify along with them, RouteTable(rearranged, table.identify), and examples/blog is the worked case. The default is for a table whose routes were never behind a declaration at all, the framework's own routes among them.

Attributes

Source
Route.scala
def naming(namers: Seq[Request => Request]): Request => Request

The one naming function a table is handed, composed out of what every declaration mounted into it names with. The generated Routes.table() calls this with the identify of the very declarations its rows were mounted behind, in the order they were mounted, so no route can be wrapped by one declaration and named by another.

The one naming function a table is handed, composed out of what every declaration mounted into it names with. The generated Routes.table() calls this with the identify of the very declarations its rows were mounted behind, in the order they were mounted, so no route can be wrapped by one declaration and named by another.

distinct for the reason the rows themselves are taken distinct: one guard hands the same function to every declaration it makes, so an application with twenty guarded things reads the session once per upgrade rather than twenty times. Equality on a function value is equality of the reference and nothing else, which is exactly what a shared instance wants. A declaration that names nobody hands the request straight back, so composing one costs an application with no guard nothing it can measure.

Attributes

Source
Route.scala

Concrete fields

Attributes

Source
Route.scala