next.js/test/e2e/testmode/middleware.js
middleware.js15 lines327 B
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),
    },
  })
}
Quest for Codev2.0.0
/
SIGN IN