IWinterTcFetch: { fetch: WinterTcRequestHandler }

Defines the contract for a WinterTC-compatible fetch function.

WinterTC is a cross-runtime fetch standard that allows HTTP routers and handlers to be portable across different JavaScript runtimes (Node.js, Bun, Deno, Cloudflare Workers, etc.) by adhering to the standard fetch API signature.

Implementing this interface ensures that a router can be used as a WinterTC-compatible request handler, enabling seamless integration with WinterTC-based adapters and middleware.

IMPORT_PATH: "@daiso-tech/core/http-router/contracts"

Type declaration

  • fetch: WinterTcRequestHandler

    Handles an incoming HTTP request and returns a response.

    The standard Request object representing the incoming HTTP request.

    The response to send back, either synchronously or as a promise.