Skip to content

Route

Route = { handler: (req) => Promise<HttpResponse> | HttpResponse; kind: "terminal"; method: HttpMethod; } | { child: Route; kind: "path"; segment: string; } | { kind: "concat"; routes: ReadonlyArray<Route>; }

Defined in: src/http/Route.ts:18

Node type emitted by DSL builders like path(...), get(...). Internal representation is a tree that knows how to flatten into CompiledRoutes.