Beignet API reference
    Preparing search index...

    Type Alias AfterSendHook<Ctx, C>

    AfterSendHook: (
        args: {
            body?: InferBody<C>;
            contract: C;
            ctx?: Ctx;
            durationMs: number;
            error?: unknown;
            headers?: InferHeaders<C>;
            path?: InferPath<C>;
            query?: InferQuery<C>;
            req: HttpRequestLike;
            response: HttpResponseLike;
        },
    ) => MaybePromise<void>

    Hook that runs after the response has been prepared.

    This is for logging and observability. Errors thrown by afterSend hooks are ignored by the server pipeline.

    Type Parameters

    Type Declaration