|
@ -660,16 +660,20 @@ ExpressApp.prototype.start = function(opts, cb) { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
router.get('/v1/fiatrates/:code/', function(req, res) { |
|
|
router.get('/v1/fiatrates/:code/', function(req, res) { |
|
|
getServerWithAuth(req, res, function(server) { |
|
|
var server; |
|
|
var opts = { |
|
|
var opts = { |
|
|
code: req.params['code'], |
|
|
code: req.params['code'], |
|
|
source: req.query.source, |
|
|
provider: req.query.provider, |
|
|
ts: +req.query.ts, |
|
|
ts: +req.query.ts, |
|
|
}; |
|
|
}; |
|
|
server.getFiatRate(opts, function(err, rates) { |
|
|
try { |
|
|
if (err) return returnError(err, res, req); |
|
|
server = getServer(req, res); |
|
|
res.json(rates); |
|
|
} catch (ex) { |
|
|
}); |
|
|
return returnError(ex, res, req); |
|
|
|
|
|
} |
|
|
|
|
|
server.getFiatRate(opts, function(err, rates) { |
|
|
|
|
|
if (err) return returnError(err, res, req); |
|
|
|
|
|
res.json(rates); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|