Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upgrade guide for Middleware. #37382

Merged
merged 23 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update middleware-upgrade-guide.md
  • Loading branch information
leerob authored Jun 8, 2022
commit 4456fdeee19b28865bdcb3ab3a3309c788123800
6 changes: 3 additions & 3 deletions errors/middleware-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
return NextResponse.rewrite(new URL('/about-2', request.url))
leerob marked this conversation as resolved.
Show resolved Hide resolved
}
// Config with custom matcher
// Pending: https://github.com/vercel/next.js/pull/37177

// Supports both a single string value or an array of matchers
export const config = {
leerob marked this conversation as resolved.
Show resolved Hide resolved
leerob marked this conversation as resolved.
Show resolved Hide resolved
matcher: '/about/:path*',
matcher: ['/about/:path*', '/dashboard/:path*'],
}
```

leerob marked this conversation as resolved.
Show resolved Hide resolved
Expand Down