| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1x 2x 2x 2x 2x 2x 1x 1x 1x | var Api = require('./Api')
class GetApi {
constructor(opts, config, logger) {
this.opts = opts
this.logger = logger
this.api = new Api(config)
}
run(cb) {
this.api.makeRequest('GET', this.opts.route, JSON.parse(this.opts.params || '{}'), (err, response) => {
if (err) return cb(err)
this.logger.info(JSON.stringify(response, null, 2))
return cb(null, response)
})
}
}
module.exports = GetApi
|