group method

SymlinkRoute<T> group (String path, void callback(Router<T> router), { Iterable<T> middleware, String name })

Creates a route, and allows you to add child routes to it via a Router instance.

Returns the created route. You can also register middleware within the router.

Implementation

SymlinkRoute<T> group(String path, void callback(Router<T> router),
    {Iterable<T> middleware, String name}) {
  middleware ??= <T>[];
  final router = new Router<T>().._middleware.addAll(middleware);
  callback(router);
  return mount(path, router)..name = name;
}