(method, path)
| 88 | // params: any :-params that got parsed from the path |
| 89 | // Returns undefined if there is no match. |
| 90 | match(method, path) { |
| 91 | for (var route of this.routes) { |
| 92 | if (route.method != method) { |
| 93 | continue; |
| 94 | } |
| 95 | const layer = route.layer || new Layer(route.path, null, route.handler); |
| 96 | const match = layer.match(path); |
| 97 | if (match) { |
| 98 | const params = layer.params; |
| 99 | Object.keys(params).forEach(key => { |
| 100 | params[key] = validateParameter(key, params[key]); |
| 101 | }); |
| 102 | return { params: params, handler: route.handler }; |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // Mount the routes on this router onto an express app (or express router) |
| 108 | mountOnto(expressApp) { |
no test coverage detected