Router class

Constructors

Router({dynamic address})

Properties

address ↔ dynamic
getter/setter pair
bindings List<RouteBinding>
getter/setter pair
container StewardContainer
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
middleware List<MiddlewareFunc>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server HttpServer?
getter/setter pair

Methods

connect(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
delete(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
get(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
options(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
patch(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
post(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
processHandlersWithMiddleware(Future<Response> initialHandler(Context context), List<Function> allMiddlewares, Context context, HttpRequest request) Future<void>
put(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
serveHTTP() Future
setDIContainer(StewardContainer container) → void
staticFiles(String path, {List<MiddlewareFunc> middleware = const []}) → void
terminate() Future
forcibly shut down the server userful if the server is running in the background
toString() String
A string representation of this object.
inherited
trace(String path, RequestCallback handler, {List<MiddlewareFunc> middleware = const []}) → void
writeErrorResponse(dynamic request, dynamic err, dynamic stacktrace) Future<void>

Operators

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