remix/router · InterfaceView Source
RouterOptions
Summary
Options for creating a router.
Signature
interface RouterOptions<context, middleware> {
defaultHandler?: RequestHandler<MiddlewareContext<middleware, context>>;
matcher?: MultiMatcher<RouteEntry>;
middleware?: readonly [middleware];
}
Properties
defaultHandler
The default request handler that runs when no route matches.
Defaults to a 404 Not Found response.
matcher
The matcher to use for matching routes.
middleware
Middleware to run for every request handled by this router.
Keep this array tuple-typed when you want MiddlewareContext<typeof middleware> to preserve
the exact context contributions of each middleware.