RouteMatcher
Defined in: route-matcher.ts:15
Route matcher class
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RouteMatcher(
routes):RouteMatcher
Defined in: route-matcher.ts:18
Parameters
Section titled “Parameters”routes
Section titled “routes”Returns
Section titled “Returns”RouteMatcher
Methods
Section titled “Methods”addRoute()
Section titled “addRoute()”addRoute(
route):void
Defined in: route-matcher.ts:53
Add a route
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
getRoutes()
Section titled “getRoutes()”getRoutes(): readonly
RouteConfig[]
Defined in: route-matcher.ts:72
Get all routes
Returns
Section titled “Returns”readonly RouteConfig[]
match()
Section titled “match()”match(
req):MatchedRoute|null
Defined in: route-matcher.ts:25
Match request to a route
Parameters
Section titled “Parameters”IncomingMessage
Returns
Section titled “Returns”MatchedRoute | null
removeRoute()
Section titled “removeRoute()”removeRoute(
path):boolean
Defined in: route-matcher.ts:60
Remove a route
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean