A routable server that can handle dynamic requests.

Inheritance
Implemented by

Constructors

Routable()

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
properties → Map

A set of custom properties that can be assigned to the server.

read / write, inherited
requestMiddleware → Map<String, RequestMiddleware>

Additional filters to be run on designated requests.

read / write
routes → List<Route>

Dynamic request paths that this server will respond to.

read / write
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
services → Map<Pattern, Service>

A set of Service objects that have been mapped into routes.

read / write

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

addRoute(String method, Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to the given path for requests with the given method (case-insensitive). Provide '*' as the method to respond to all methods.

all(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to any request matching the given path.

delete(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a DELETE request.

get(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a GET request.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
patch(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a PATCH request.

post(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a POST request.

registerMiddleware(String name, RequestMiddleware middleware(RequestContext req, ResponseContext res)) → dynamic

Assigns a middleware to a name for convenience.

service(Pattern path) Service

Retrieves the service assigned to the given path.

toString() → String

Returns a string representation of this object.

inherited
use(Pattern path, Routable routable, {bool hooked: true, String middlewareNamespace: null}) → dynamic

Incorporates another Routable's routes into this one's.