Skip to main content
Module

x/fsrouter/mod.ts>RouterOptions

A file system based router for Deno.
Latest
interface RouterOptions
import { type RouterOptions } from "https://deno.land/x/fsrouter@3.1.0/mod.ts";

A collection of options to be passed in on initialization.

Properties

bootMessage: boolean

Whether or not an information message should be shown on startup. Defaults to true.

debug: boolean

Whether or not to output debug information to console. Defaults to false.

convertToNumber: boolean

Whether or not slugs of type :number should be automatically converted to numbers in the matches object.

For example, given the slug [id:number]:

  • if convertToNumber === true, then (typeof slugs.id) === 'number'
  • if convertToNumber === false, then (typeof slugs.id) === 'string'

Defaults to true.

generateManifest: boolean

Whether or not a manifest file should be generated containing static imports for all routes. This manifest file is needed for Deno environments that do not support dynamic imports, e.g. Deno Deploy. The location of the manifest file is as a sibling to the supplied root directory.

Set this option to false if you don't need this manifest, e.g. you're deploying to a Deno environment that supports dynamic imports.

Defaults to true.

_routes: Route[]