Back to Developer Roadmap

Route Matcher

src/data/roadmaps/nextjs/content/route-matcher@Sn-8ztsjjtUxD_SP6w3cS.md

4.0692 B
Original Source

Route Matcher

A route matcher in Next.js middleware allows you to conditionally execute middleware based on the incoming request's path. It defines specific patterns or conditions that the request path must satisfy for the middleware to run. This enables you to apply middleware logic only to certain routes or groups of routes within your application, providing fine-grained control over request handling.

Visit the following resources to learn more: