mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Testmode is refactored to support both serverless and edge functions under a sandbox.
15 lines
327 B
JavaScript
15 lines
327 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export const config = {
|
|
matcher: ['/app/rsc-fetch'],
|
|
}
|
|
|
|
export async function middleware() {
|
|
const text = await (await fetch('https://example.com/middleware')).text()
|
|
return NextResponse.next({
|
|
headers: {
|
|
'x-middleware-fetch': encodeURIComponent(text),
|
|
},
|
|
})
|
|
}
|