CodeZettaInterview Hub

Next.js · Middleware · Fresh / Intern · Concept

What is Next.js Middleware?

Short Interview Answer

A function running before a request is completed, often at the Edge, for redirects, rewrites, headers, and coarse auth.

Detailed Explanation

Configured via `middleware.ts` and a matcher. Keep it light — not a full app server. It cannot replace server-side authorization for data access.

Did you know this answer?