Update middleware-upgrade-guide to be consistent (#38102)
Update middleware-upgrade-guide.md Ensure that before and after examples are consistent
This commit is contained in:
parent
9cc1c3c576
commit
a90349d519
1 changed files with 3 additions and 2 deletions
|
@ -171,6 +171,7 @@ As well as other extended methods from `Map`.
|
|||
#### Before
|
||||
|
||||
```javascript
|
||||
// pages/_middleware.ts
|
||||
import { NextResponse } from 'next/server'
|
||||
import type { NextRequest } from 'next/server'
|
||||
|
||||
|
@ -246,7 +247,7 @@ The helper is imported from `next/server` and allows you to opt in to using the
|
|||
#### Before
|
||||
|
||||
```typescript
|
||||
// middleware.ts
|
||||
// pages/_middleware.ts
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
|
@ -291,7 +292,7 @@ Use [`URLPattern`](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern)
|
|||
#### Before
|
||||
|
||||
```typescript
|
||||
// middleware.ts
|
||||
// pages/_middleware.ts
|
||||
import { NextResponse } from 'next/server'
|
||||
import type { NextRequest } from 'next/server'
|
||||
|
||||
|
|
Loading…
Reference in a new issue