(url, options)
| 4 | |
| 5 | // get content from an addons registry |
| 6 | var get = function(url, options) { |
| 7 | var d = Q.defer(); |
| 8 | request(_.extend({ |
| 9 | method: "GET", |
| 10 | url: url+"/api/addons?limit=1000", |
| 11 | json: true, |
| 12 | headers: {} |
| 13 | }, options || {}), |
| 14 | function(error, response, body) { |
| 15 | if (!error && response.statusCode == 200) { |
| 16 | d.resolve(body); |
| 17 | } else { |
| 18 | d.reject(error || body.message || body); |
| 19 | } |
| 20 | }); |
| 21 | |
| 22 | return d.promise; |
| 23 | }; |
| 24 | |
| 25 | module.exports = { |
| 26 | 'get': get |
nothing calls this directly
no outgoing calls
no test coverage detected