aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rates.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rates.js')
-rw-r--r--lib/rates.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rates.js b/lib/rates.js
index b9e889fb..80c22bf0 100644
--- a/lib/rates.js
+++ b/lib/rates.js
@@ -27,7 +27,9 @@ let fetchRates;
try {
let {
data: { rates: fx }
- } = await axios.get(`http://data.fixer.io/api/latest?access_key=${config.fixer}`);
+ } = await axios.get(
+ `http://data.fixer.io/api/latest?access_key=${config.fixer}`
+ );
let USD = fx["USD"];
Object.keys(fx).map(k => {
fx[k] = parseFloat((fx[k] / fx["USD"]).toFixed(6));
@@ -44,10 +46,12 @@ let fetchRates;
setTimeout(fetchRates, 7200000);
})();
-app.get('/rates',
+app.get(
+ "/rates",
ah(async (req, res, next) => {
res.send(app.get("rates"));
- }));
+ })
+);
setInterval(() => {
broadcast("rate", app.get("last"));