Skip to main content
Module

x/http_fns/lazy.ts>lazy

A bunch of functions for building HTTP servers
Go to Latest
function lazy
import { lazy } from "https://deno.land/x/http_fns@v0.0.27/lazy.ts";

Create a handler that lazily loads a handler fn only when required.

Type Parameters

A extends unknown[]
optional
H = (req: Request, ...args: A) => Awaitable<Response | null>

Parameters

handlerLoader: (() => Promise<H | { default: H; }>) | string | URL

function to load the handler fn, or a module or module specifier that exports the handler as the default export.