mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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]>
13 lines
397 B
TypeScript
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'],
|
|
}
|