import { IRouteTable } from '../interfaces' ; import { Attribute , RouteAttribute } from '../constants' ; export class RouteTable implements IRouteTable { private routes : string [ ] = [ ] ; add ( route , httpVerb ) { const url = httpVerb === RouteAttribute [ Attribute . httpAll ] ? `/:verb_${ route }` : `/${ httpVerb }_${ route }` ; this . routes . push ( url . toLowerCase ( ) ) ; } getRoutes ( ) { return this . routes ; } static create ( ) { return new RouteTable ( ) ; } }