diff options
| author | Adam Soltys <[email protected]> | 2021-05-13 02:24:05 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-05-13 02:24:05 -0400 |
| commit | 4d2379b801ed0a95e8538a64873a0be503e74672 (patch) | |
| tree | 8114688e98443e0ab536e7367eecb2f5d40aafe0 /lib/rates.js | |
| parent | 7d6d6ca74f1f271427c271382fff49446aaa1895 (diff) | |
| download | coinos-server-4d2379b801ed0a95e8538a64873a0be503e74672.tar.gz coinos-server-4d2379b801ed0a95e8538a64873a0be503e74672.zip | |
confidential to non-confidential liquid conversion
Diffstat (limited to 'lib/rates.js')
| -rw-r--r-- | lib/rates.js | 10 |
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")); |
