Beignet API reference
    Preparing search index...

    Type Alias NextRouteServer<Ctx>

    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.

    type NextRouteServer<Ctx> = {
        createRequestContext: (req: HttpRequestLike) => Promise<Ctx>;
    }

    Type Parameters

    • Ctx
    Index
    createRequestContext: (req: HttpRequestLike) => Promise<Ctx>