Next.js Quiz
Advanced Configuration & Security
Test your mastery of rewrites/redirects, middleware matcher routing, instrumentation startup, React taint APIs, and transpilePackages.
Question 1 of 100%
How do you restrict Middleware to execute only on specific paths instead of running on every request?
javascript
// middleware.ts
export const config = {
matcher: ['/dashboard/:path*', '/profile/:path*']
}