| 4 | // RouteTable has the list of routes registered with dino |
| 5 | // but these routes are registered after invoking .bind(). |
| 6 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected