chain method

_ChainedRouter<T> chain (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 = new _ChainedRouter<T>(this, middleware);
  var route = new SymlinkRoute<T>('/', piped);
  _routes.add(route);
  return piped;
}