Skip to main content
Module

x/peko/mod.ts>routesFromDir

Featherweight HTTP routing + utils for stateless apps 🐣
Latest
variable routesFromDir
import { routesFromDir } from "https://deno.land/x/peko@2.1.0/mod.ts";

Recursively create an array of routes with the static handler for all files/sub-directories in the provided directory.

type

(
dirUrl: URL,
routeGen: (path: `/${string}`, url: URL) => Promise<Route> | Route,
_depth?,
) => Promise<Route[]>