Spry class final

A Spry application with routes, middleware, and error handlers.

Constructors

Spry({Map<String, RouteHandlers> routes = const {}, Iterable<MiddlewareRoute> middleware = const [], Iterable<ErrorRoute> errors = const [], RouteHandlers? fallback, String? publicDir})
Creates an application from route, middleware, and error definitions.

Properties

errors → Router<ErrorHandler>
Error handler router.
final
fallback RouteHandlers?
Optional fallback handlers.
final
hashCode int
The hash code for this object.
no setterinherited
middleware → Router<Middleware>
Middleware router.
final
publicDir String?
Normalized public asset directory.
final
router → Router<Handler>
Route handler router.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetch(Request request, RequestContext context) Future<Response>
Handles a request by serving public assets, then middleware and routes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited