MCPcopy
hub / github.com/vercel/next.js / init

Function init

test/integration/edge-runtime-module-errors/test/index.test.ts:52–63  ·  view source on GitHub ↗
(importStatement)

Source from the content-addressed store, hash-verified

50 title: 'Edge API',
51 url: routeUrl,
52 init(importStatement) {
53 context.api.write(`
54 import { NextResponse } from 'next/server'
55
56 export default async function handler(request) {
57 const { writeFile } = ${importStatement}
58 return Response.json({ ok: writeFile() })
59 }
60
61 export const config = { runtime: 'edge' }
62 `)
63 },
64 },
65 {
66 title: 'Middleware',

Callers 1

index.test.tsFile · 0.70

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected