IgMiddlewareHandler
Routes specified in routes
follow the same pattern as the Next.js matcher.
MUST start with
/
Can include named parameters:
/about/:path
matches/about/a
and/about/b
but not/about/a/c
Can have modifiers on named parameters (starting with
:
):/about/:path*
matches/about/a/b/c
because*
is zero or more.?
is zero or one and+
one or moreCan use regular expression enclosed in parenthesis:
/about/(.*)
is the same as/about/:path*
Read more details on path-to-regexp documentation.