Beignet API reference
    Preparing search index...

    Type Alias ResolvedRoute<_Ctx, C>

    Compiled route entry used by server internals and adapter helpers.

    type ResolvedRoute<_Ctx, C extends HttpContractConfig> = {
        contract: C;
        handler: (
            req: HttpRequestLike,
            params?: Record<string, string>,
        ) => Promise<HttpResponse>;
        match: (
            method: string,
            pathname: string,
        ) => { matched: true } | { matched: false };
    }

    Type Parameters

    Index

    Properties

    contract: C

    Contract config for the route.

    handler: (
        req: HttpRequestLike,
        params?: Record<string, string>,
    ) => Promise<HttpResponse>

    Handler that receives the raw request and optional path params.

    match: (
        method: string,
        pathname: string,
    ) => { matched: true } | { matched: false }

    Test whether the route matches an incoming method and pathname.