diff options
| author | secondl1ght <[email protected]> | 2022-10-25 18:01:42 -0600 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-10-25 18:01:42 -0600 |
| commit | aa6debcd83c0b4067e0f8ce9a11d9c9ac02476ad (patch) | |
| tree | 25b2d3e72b4b545a1eaf15a10127c6537a4d9339 /src/routes/+layout.server.js | |
| parent | 1d6c3f68c6f9d992122e427a7cb24be13aa1e988 (diff) | |
| download | coinos-ui-aa6debcd83c0b4067e0f8ce9a11d9c9ac02476ad.tar.gz coinos-ui-aa6debcd83c0b4067e0f8ce9a11d9c9ac02476ad.zip | |
hook up locations map to btc map api and OSM data
Diffstat (limited to 'src/routes/+layout.server.js')
| -rw-r--r-- | src/routes/+layout.server.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 84e5ce5c..e110b467 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -39,5 +39,17 @@ export async function load({ cookies, request, url, params }) { let rate = await get('/rate'); rates = await get('/rates'); - return { subject, user, token, rate, rates }; + +let locations = await fetch('https://api.btcmap.org/v2/elements?updated_since=2022-09-19') + .then((r) => r.text()) + .then((body) => { + try { + return JSON.parse(body); + } catch (e) { + throw new Error(body); + } + }); + + + return { subject, user, token, rate, rates, locations }; } |
