Unverified Commit 4875c584 authored by Hyungji's avatar Hyungji Committed by GitHub

docs:` Redirecting` fix route handler path (#72617)

Hi, Team.
The path of route handler seems to be missing `api` and I'd like to fix
it.
(`middleware.ts` above the route handler file, it requests to
`/api/redirects..`)
<img width="650" alt="image"
src="https://github.com/user-attachments/assets/f9ff3034-de36-42ec-8d85-a4a923005fdf">

Thank you :) 

### Improving Documentation

- correct route handler path

---------
Co-authored-by: 's avatarhyungji <hj@doodlin.co.kr>
Co-authored-by: 's avatarDelba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
parent 4d652f71
...@@ -506,7 +506,7 @@ export async function middleware(request) { ...@@ -506,7 +506,7 @@ export async function middleware(request) {
Then, in the Route Handler: Then, in the Route Handler:
```ts filename="app/redirects/route.ts" switcher ```tsx filename="app/api/redirects/route.ts" switcher
import { NextRequest, NextResponse } from 'next/server' import { NextRequest, NextResponse } from 'next/server'
import redirects from '@/app/redirects/redirects.json' import redirects from '@/app/redirects/redirects.json'
...@@ -534,7 +534,7 @@ export function GET(request: NextRequest) { ...@@ -534,7 +534,7 @@ export function GET(request: NextRequest) {
} }
``` ```
```js filename="app/redirects/route.js" switcher ```js filename="app/api/redirects/route.js" switcher
import { NextResponse } from 'next/server' import { NextResponse } from 'next/server'
import redirects from '@/app/redirects/redirects.json' import redirects from '@/app/redirects/redirects.json'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment