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;
}