Creates a mountable Router instance whose routes registered via verb methods
(get/post/put/patch/delete/head/options/all/connect/trace)
or route() are all gated by an authentication provider. Middleware registered
via router.use(...) is intentionally NOT auto-gated; the gate is route-scoped
to keep mount-order behavior predictable for downstream callers.
Behaves like the exported Router() factory (including optional route-parameter
rewriting), with the addition of setAuthenticationProvider.
Creates a mountable Router instance whose routes registered via verb methods (
get/post/put/patch/delete/head/options/all/connect/trace) orroute()are all gated by an authentication provider. Middleware registered viarouter.use(...)is intentionally NOT auto-gated; the gate is route-scoped to keep mount-order behavior predictable for downstream callers.Behaves like the exported
Router()factory (including optional route-parameter rewriting), with the addition ofsetAuthenticationProvider.