Files
d540fbd3e6 Deprecate Middleware API and add Proxy API (#84764)
Following up on https://github.com/vercel/next.js/pull/84119, this PR
deprecated the user-facing middleware API and added a replacement Proxy
API.

---------

Co-authored-by: JJ Kasper <[email protected]>
2025-10-14 20:09:14 +02:00

13 lines
397 B
TypeScript

import type { ProxyConfig } from 'next/server'
export default async function middleware() {
// This import should not be instrumented.
// `trackDynamicImport` will throw if it's used in the edge runtime,
// so it's enough to just do an import() here and see if it succeeds.
await import('./messages')
}
export const config: ProxyConfig = {
matcher: ['/not-instrumented/middleware'],
}