Skip to content

Commit a90349d

Browse files
Update middleware-upgrade-guide to be consistent (#38102)
Update middleware-upgrade-guide.md Ensure that before and after examples are consistent
1 parent 9cc1c3c commit a90349d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

errors/middleware-upgrade-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ As well as other extended methods from `Map`.
171171
#### Before
172172

173173
```javascript
174+
// pages/_middleware.ts
174175
import { NextResponse } from 'next/server'
175176
import type { NextRequest } from 'next/server'
176177

@@ -246,7 +247,7 @@ The helper is imported from `next/server` and allows you to opt in to using the
246247
#### Before
247248

248249
```typescript
249-
// middleware.ts
250+
// pages/_middleware.ts
250251
import { NextRequest, NextResponse } from 'next/server'
251252

252253
export function middleware(request: NextRequest) {
@@ -291,7 +292,7 @@ Use [`URLPattern`](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern)
291292
#### Before
292293

293294
```typescript
294-
// middleware.ts
295+
// pages/_middleware.ts
295296
import { NextResponse } from 'next/server'
296297
import type { NextRequest } from 'next/server'
297298

0 commit comments

Comments
 (0)