import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; import { createLogger } from "./shared/logging/logger"; const logger = createLogger("web:navigation"); export function proxy(request: NextRequest) { // Probes hit "/web-health" and are excluded by the matcher below. The // User-Agent guard stays as a fallback for anything else that polls // without one, so real navigation isn't drowned out in the logs. if (request.headers.get("user-agent")) { logger.info("page request", { method: request.method, path: request.nextUrl.pathname, }); } return NextResponse.next(); } export const config = { matcher: [ "/((?!_next/static|_next/image|favicon.ico|api|web-health).*)", ], };