RouteHandlerFunction
To learn how to use RouteHandlerFunction
, see Server-Side Routing.
RouteHandlerFunction
takes:
It returns a RouteHandlerViewResponse
.
A ViewRequest
object has to have:
- a URL
- a path (
requestPath
)
ViewRequest
can optionally have any number of:
- parameters (
params
) - queries (
query
)
For example, the ViewRequest
object for the request get http://www.example.com/custom/thing?sort=desc
looks like this.
A HandlerContext
object has to have:
- a route in the form of an
LwrRoute
or anLwrErrorRoute
object - a
RouteHandlerViewApi
call
The RouteHandlerViewApi
calls the functions:
hasViewResponse
- Takes a
RouteHandlerView
and aRecord
- Returns a boolean
- Takes a
getViewResponse
- Takes a
RouteHandlerView
and aRecord
- Returns a
RouteHandlerViewResponse
orundefined
- Takes a
A RouteHandlerView
object has this syntax:
See Also