FindMyWay
A radix-tree HTTP router used by the unstable HTTP routing modules.
Constructors
Models
FindResult interface
Added in v4.0.0
Source
Signature
interface FindResult<A> { readonly handler: A; readonly params: Record<string, string | undefined>; readonly searchParams: Record<string, string | Array<string>>;}Signature
type PathInput = `/${string}` | "*";Signature
interface Router<A> { readonly all: (path: PathInput, handler: A) => void; readonly find: (method: string, url: string) => FindResult<A> | undefined; readonly has: (method: string, url: string) => boolean; readonly on: (method: string | Iterable<string, any, any>, path: PathInput, handler: A) => void;}RouterConfig interface
Added in v4.0.0
Source
Signature
interface RouterConfig { readonly caseSensitive: boolean; readonly ignoreDuplicateSlashes: boolean; readonly ignoreTrailingSlash: boolean; readonly maxParamLength: number;}