(method, path, request)
| 119 | } |
| 120 | |
| 121 | tryRouteRequest(method, path, request) { |
| 122 | var match = this.match(method, path); |
| 123 | if (!match) { |
| 124 | throw new Parse.Error(Parse.Error.INVALID_JSON, 'cannot route ' + method + ' ' + path); |
| 125 | } |
| 126 | request.params = match.params; |
| 127 | return new Promise((resolve, reject) => { |
| 128 | match.handler(request).then(resolve, reject); |
| 129 | }); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | // A helper function to make an express handler out of a a promise |
no test coverage detected