2018-11-06 10:13:32 +00:00
|
|
|
/* eslint-disable no-underscore-dangle */
|
|
|
|
|
|
|
|
// This entrypoint gets inlined in the index page cached by service workers
|
|
|
|
// and is responsible for fetching the data we would otherwise embed
|
|
|
|
|
2018-11-09 05:30:31 +00:00
|
|
|
window.__env__ = fetch('/data', {
|
2018-11-06 10:13:32 +00:00
|
|
|
credentials: 'same-origin'
|
|
|
|
}).then(res => {
|
|
|
|
if (res.ok) {
|
|
|
|
return res.json();
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new Error(res.statusText);
|
|
|
|
});
|