Skip to main content
Module

x/http_fns/static.ts>staticRoute

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

Create a Request handler that serves static files under a matched URL pattern.

Parameters

pattern: string

the URL pattern to match

fileRootUrl: string

the root from where the files are served (this should be a file:// URL)

optional
options: StaticRouteOptions

Returns

(request: Request) => Awaitable<Response | null>

a Request handler that always returns a Response