Instance Method
group(_:configure:)
Creates a new
Router wrapped in the supplied array of Middleware.func group(_ middleware: [any Middleware], configure: (any RoutesBuilder) throws -> ()) rethrows
Parameters
middlewareArray of
[Middleware]to wrapRouterin.configureClosure to configure the newly created
Router.
Discussion
router.group([FooMiddleware(), BarMiddleware()]) { group in
// all routes added will be wrapped by Foo & Bar middleware
group.get(...) { ... }
}