/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
test/e2e/app-dir/proxy-runtime-nodejs/proxy.ts
11 строк
321 B
Niklas Mischkulnig
Only allow node runtime in proxy (#85139)
22 окт 2025, 02:06
Не верифицирован
22 окт 2025, 02:06
074262b
Код
Авторство
О чём код?
import { NextRequest, NextResponse } from 'next/server' // Will not work in edge runtime import { join } from 'path/posix' export function proxy(request: NextRequest) { if (request.nextUrl.pathname === join('/', 'foo')) { return NextResponse.redirect(new URL('/', request.url)) } return NextResponse.next() }