Beignet API reference
    Preparing search index...

    Interface HttpAdapter<NativeRequest, NativeResponse>

    Contract implemented by packages that adapt Beignet's framework-neutral server runtime to a platform HTTP API.

    Core owns request parsing, hooks, route matching, validation, error mapping, response ownership, and provider lifecycle. Adapters own only the conversion between the platform request/response types and Beignet's HttpRequestLike / HttpResponse boundary.

    interface HttpAdapter<NativeRequest, NativeResponse> {
        name: string;
        createHandler(
            handler: HttpAdapterApiHandler,
        ): HttpAdapterHandler<NativeRequest, NativeResponse>;
        toNativeResponse(
            res: HttpResponse,
        ): NativeResponse | Promise<NativeResponse>;
        toRequestLike(req: NativeRequest): HttpRequestLike;
    }

    Type Parameters

    • NativeRequest
    • NativeResponse
    Index
    name: string

    Human-readable adapter name for diagnostics and documentation.