mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
When using `proxy`, the `Compiled X in ...` message in Turbopack had hardcoded `middleware`. Therefore, modify to display `proxy` if using a proxy. Also, Webpack displayed with a leading slash `/proxy`, which could be misinterpreted as a route, so I removed the leading slash.
6 lines
137 B
TypeScript
6 lines
137 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
export function proxy(req: Request) {
|
|
return NextResponse.rewrite(new URL('/', req.url))
|
|
}
|