Skip to main content
Module

x/allo_routing/mod.ts>RouterList

🦕 Routing solution for Deno
Go to Latest
class RouterList
implements IRouter
import { RouterList } from "https://deno.land/x/allo_routing@v2.1.1/mod.ts";

Class RouterList is main object. Contains all routers.

const router = new RouterList();

// ...

if (router.match(request)) {
   const response = await router.serveResponse(request);
}

Constructors

new
RouterList(options?: RouterOptions)

Methods

add(...entry: AddMethodEntry): this

Add route or router to list.

deprecated
addRouter(router: IRouter): void
getErrorReponse(
status: number,
req: Request,
params?: Record<string, string>,
): Promise<Response>
match(req: Request): Promise<boolean>
setError(serveResponse: ServeResponseType): void
startsWith(path: string): RouterList