I'm currently working on a Next.js 13 project and I'm trying to understand the role of middleware within the framework. In Next.js 13, is middleware considered server-side or client-side?
I have looked at the Next.js documentation where i can't find an explanation whether middleware is client side or server side.
Could someone clarify whether middleware in Next.js 13 is categorized as server-side or client-side? Additionally, it would be helpful to understand any specific use cases or limitations for middleware in this version of Next.js.
import { NextResponse } from 'next/server'
). As for use cases, it's too broad question, it basically allows you to do anything with the response. From the docs:you can modify the response by rewriting, redirecting, modifying the request or response headers, or responding directly.
– Roath