existing signature: (req: Request) => Promise<Response>
two options:
-
method on the request
req.sendEarlyHints(headers)
-
part of the response
type EarlyHint = { headers: Headers; response: Promise<Response> };
type Handler = (req: Request) => Promise<Response> | Promise<EarlyHint>;
existing signature:
(req: Request) => Promise<Response>two options:
method on the request
req.sendEarlyHints(headers)part of the response