chain method

_ChainedRouter<T> chain (
  1. Iterable<T> middleware
)

Prepends the given middleware to any routes created by the resulting router.

The resulting router can be chained, too.

Implementation

_ChainedRouter<T> chain(Iterable<T> middleware) {
  var piped = _ChainedRouter<T>(this, middleware);
  var route = SymlinkRoute<T>('/', piped);
  _routes.add(route);
  return piped;
}