Instruction clarification
This commit is contained in:
@@ -94,6 +94,17 @@ niżej.
|
||||
> eksportu, niezależna od nazwy pliku projektu. Migracja:
|
||||
> `npx @next/codemod@canary middleware-to-proxy .`
|
||||
|
||||
> **Zalecane (aktualne): `createProxy`** — robi negocjację locale, redirect
|
||||
> roota, cookie języka za zgodą i nagłówki `x-locale` / `x-pathname`:
|
||||
> ```ts
|
||||
> import { NextResponse } from 'next/server'
|
||||
> import { createProxy } from '@intecion/ipal-kit'
|
||||
> import { i18nConfig } from '@/i18n.config'
|
||||
> export const proxy = createProxy(i18nConfig, { NextResponse })
|
||||
> export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
> ```
|
||||
> Ręczny wariant poniżej tylko gdy potrzebujesz własnej logiki w proxy.
|
||||
|
||||
```ts
|
||||
// proxy.ts (projekt klienta) — jedyna logika to podłączenie
|
||||
import { NextResponse } from 'next/server'
|
||||
|
||||
Reference in New Issue
Block a user