(req, res, buffer, callback)
| 58 | } |
| 59 | |
| 60 | resolve (req, res, buffer, callback) { |
| 61 | let urlinfo = url.parse(req.url, true); |
| 62 | let pathname = urlinfo.pathname; |
| 63 | if (this.serviceName && pathname.indexOf(this.serviceName) !== 1) { |
| 64 | let e = new Error(`Local Service Not Loaded: ${pathname}`); |
| 65 | e.statusCode = 404; |
| 66 | return callback(e); |
| 67 | } else { |
| 68 | pathname = pathname.substr(1 + this.serviceName.length); |
| 69 | } |
| 70 | let definition; |
| 71 | try { |
| 72 | definition = this.findDefinition(this.definitions, pathname); |
| 73 | } catch (e) { |
| 74 | e.statusCode = 404; |
| 75 | return callback(e); |
| 76 | } |
| 77 | return callback(null, definition, {}, buffer); |
| 78 | } |
| 79 | |
| 80 | end (req, value) { |
| 81 | value = value === undefined ? null : value; |
nothing calls this directly
no outgoing calls
no test coverage detected