Skip to content
Permalink
Browse files

fetching santa and his route

  • Loading branch information
colbyfayock committed Dec 10, 2019
1 parent 58106ba commit f42c48fb0f0d70b4d20f1c2a1410bde1a4f27e84
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/pages/index.js
@@ -21,7 +21,17 @@ const IndexPage = () => {
*/

async function mapEffect({ leafletElement } = {}) {
// Get rid of everything in here
if ( !leafletElement ) return;
let santa, santaJson, route, routeJson;
try {
santa = await fetch('https://santa-api.appspot.com/info?client=web&language=en&fingerprint=&routeOffset=0&streamOffset=0');
santaJson = await santa.json();
route = await fetch(santaJson.route);
routeJson = await route.json();
} catch(e) {
throw new Error(`Failed to find Santa!: ${e}`)
}
console.log('routeJson', routeJson);
}

const mapSettings = {

0 comments on commit f42c48f

Please sign in to comment.
You can’t perform that action at this time.