Minimal server surface required by the Next.js route factories.
Both a NextServer and a core ServerInstance satisfy this shape
structurally, so route modules built on these factories are executable
under a standard test runner: construct the route with a fake server exposing
createRequestContext and invoke the exported handlers with a plain
Request. No Next.js runtime (next/headers) is involved.
When the server also exposes rawRoute(...) — real Beignet servers do —
the factories run their handler through the full hooks pipeline (rate
limiting, CORS, logging, error reporting, instrumentation). Minimal fakes
without it keep the direct createRequestContext flow.
Minimal server surface required by the Next.js route factories.
Both a
NextServerand a coreServerInstancesatisfy this shape structurally, so route modules built on these factories are executable under a standard test runner: construct the route with a fake server exposingcreateRequestContextand invoke the exported handlers with a plainRequest. No Next.js runtime (next/headers) is involved.When the server also exposes
rawRoute(...)— real Beignet servers do — the factories run their handler through the full hooks pipeline (rate limiting, CORS, logging, error reporting, instrumentation). Minimal fakes without it keep the directcreateRequestContextflow.