Ara Yazılım (Middleware)
Convention
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
// İçinde `await` kullanılıyorsa bu işlev `async` olarak işaretlenebilir
export function middleware(request: NextRequest) {
return NextResponse.redirect(new URL("/home", request.url));
}
// See "Matching Paths" below to learn more
export const config = {
matcher: "/about/:path*",
};Eşleşen Yollar (Matching Paths)
Eşleştirici (Matcher)
Yapılandırılmış eşleştiriciler:
Koşullu İfadeler (Conditional Statements)
NextResponse
Çerez Kullanımı (Using Cookies)
Üstbilgileri Ayarlama (Setting Headers)
Yanıt Üretme (Producing a Response)
Gelişmiş Orta Yazılım Bayrakları (Advanced Middleware Flags)
PreviousRota İşleyicileri (Route Handlers)NextProje Organizasyonu ve Dosya Kolokasyonu (Project Organization and File Colocation)
Last updated