daho library

Daho — a fast Dart HTTP framework backed by a native H2O server.

Classes

Daho
The Daho application. Register routes and middleware on it, then call listen to start serving.
DahoConfig
Global application configuration, analogous to Fiber's fiber.Config.
DahoGroup
A group of routes sharing a common path prefix and middleware.
DahoRequest
The incoming HTTP request handed to route handlers and middleware.
DahoResponse
The HTTP response builder handed to route handlers.
Middlewares
A collection of ready-to-use middleware.
UploadedFile
A single file received through a multipart/form-data request.

Functions

defaultErrorHandler(DahoRequest req, DahoResponse res, Object error, StackTrace stackTrace) → void
The default ErrorHandler: logs the error to stderr and returns a generic 500 that reveals nothing about the failure to the client.
defaultNotFoundHandler(DahoRequest req, DahoResponse res) → void
The default NotFoundHandler: a plain 404.

Typedefs

AppBuilder = void Function(Daho app)
Function that registers routes and middleware on an app instance.
ErrorHandler = FutureOr<void> Function(DahoRequest req, DahoResponse res, Object error, StackTrace stackTrace)
Handles an error thrown by a route handler or middleware.
Middleware = FutureOr<void> Function(DahoRequest req, DahoResponse res, NextFunction next)
A middleware runs before the route handler and may short-circuit the chain by not calling next.
NextFunction = Future<void> Function()
Called by a middleware to pass control to the next handler in the chain.
NotFoundHandler = FutureOr<void> Function(DahoRequest req, DahoResponse res)
Handles a request that matched no route. Populate res with the response.
RouteHandler = FutureOr<DahoResponse> Function(DahoRequest req, DahoResponse res)
A terminal route handler that produces the response.