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

x/fsrouter/handler.ts

A file system based router for Deno.
Go to Latest
import * as fsrouter from "https://deno.land/x/fsrouter@2.8.0/handler.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 a Query type, and the third argument is the standard library ConnInfo type. The Query argument is placed as the second argument instead of the third for better ergonomics. See example below for more details.

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