New: Master Frontend System Design! Read our brand new Meta-Guide and solve the Autocomplete practice challenge.Read Master Guide
FrontendPrep
Back to Next.js Quizzes
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*']
}