MCPcopy Create free account
hub / github.com/ParallelTask/dinoloop / RouteTable

Class RouteTable

src/modules/router/route.table.ts:6–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4// RouteTable has the list of routes registered with dino
5// but these routes are registered after invoking .bind().
6export class RouteTable implements IRouteTable {
7 private routes: string[] = [];
8
9 add(route: string, httpVerb: string): void {
10 // if httpVerb is 'all', it should respond to every httpverb
11 // we could use router's named segments to achieve this
12 const url =
13 httpVerb === RouteAttribute[Attribute.httpAll] ?
14 `/:verb_${route}` : `/${httpVerb}_${route}`;
15 this.routes.push(url.toLowerCase());
16 }
17
18 getRoutes(): string[] {
19 return this.routes;
20 }
21
22 static create(): RouteTable {
23 return new RouteTable();
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected