mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
9 lines
251 B
TypeScript
9 lines
251 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
export default function proxy(request: NextRequest) {
|
|
if (request.nextUrl.pathname === '/foo') {
|
|
return NextResponse.redirect(new URL('/', request.url))
|
|
}
|
|
return NextResponse.next()
|
|
}
|