Next.js · Middle · Question 45 of 75
How do you limit which paths proxy.ts runs on?
- ✓Correct answer: Export a
configwith amatcher - 2Create a separate proxy in each route folder
- 3List the paths in the
proxyRoutessection ofnext.config
Explanation
export const config = { matcher: ['/dashboard/:path*'] } - proxy runs only for matching paths. Static files and _next are usually excluded to save resources. There's one proxy per project, located at the root (or in src).