Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fsrouter/core/types.ts

A file system based router for Deno.
Latest
import * as fsrouter from "https://deno.land/x/fsrouter@3.1.0/core/types.ts";

Type Aliases

Every file to which routes are being served must export a function of type FsHandler as its default export. FsHandler is very similar to the standard library Handler type -- the first argument is a Request object, the second argument is of type Slugs, and the third argument is the standard library type ConnInfo. The Slugs argument is placed as the second argument instead of the third for better ergonomics. See example below for more details.

Slugs is an object of text matched from route wildcards. See FsHandler example for more details.