http/http_controller_handler
library
Classes
-
ControllerArg
-
One parameter of a controller.
-
ControllerPlan
-
How to call one controller: what goes in each parameter.
-
ControllerTypes
-
Reads the parameter types of a function from its runtime type,
like
(DoxRequest, int) => Future<User>.
-
RouteParamBinder
-
One route param that a binder turns into a value before the
controller runs.
Enums
-
ArgKind
-
What Dox gives to one parameter of a controller.
-
PathType
-
The type of a path param parameter.
Functions
-
asResponse(dynamic value)
→ DoxResponse
-
value as a DoxResponse. An http exception becomes its JSON body
with its status, so a middleware can still change the status.
-
resetNullMiddlewareWarning()
→ void
-
only for tests. Do not call it in app code. Read
APP_ENV again on the next null
-
runMiddlewareAndController(DoxRequest doxReq)
→ FutureOr
-
Run middleware and controllers. It stays sync while every step gives
a plain value, so a simple route needs no Future. At the first Future
it waits, then goes on with the next item.
-
warnNullMiddleware(Object middleware, RouteData route)
→ void
-
in development (
APP_ENV is development or local), write a warning
once per middleware that gives null. null ends the request with an
empty 200, and the controller never runs. Most of the time the
middleware forgot return req. Nothing else changes.