mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Stacked to https://github.com/vercel/next.js/pull/84119 This PR adds a codemod for renaming `middleware` to `proxy`. Below are the behaviors: - Rename `middleware.*`, `src/middleware.*` to `proxy.*`, `src/proxy.*` - Rename function/variable exports from `middleware` to `proxy`. Default exports are skipped.
10 lines
276 B
TypeScript
10 lines
276 B
TypeScript
import { NextResponse, NextRequest } from 'next/server'
|
|
|
|
export async function middleware(request: NextRequest) {
|
|
const response = await fetch('/api/auth')
|
|
return NextResponse.redirect(new URL('/home', request.url))
|
|
}
|
|
|
|
export const config = {
|
|
matcher: '/about/:path*',
|
|
} |