diff --git a/src/routes/ldb/+page.svelte b/src/routes/ldb/+page.svelte
index 294d398..ce416cf 100644
--- a/src/routes/ldb/+page.svelte
+++ b/src/routes/ldb/+page.svelte
@@ -10,17 +10,13 @@
return new URLSearchParams(window.location.search).get('station');
}
- /**
- * @type {any[]}
- */
let jsonData = [] // Extract train data from the object to pass to #each
onMount(async () => {
const station = await getHeadcode();
document.getElementById('station').textContent = station;
const data = await fetch(`https://owlboard.info/api/v1/ldb/${station}`);
- const jsonData = await data.json()['GetStationBoardResult'];
- //document.getElementById('data_raw').textContent = JSON.stringify(await data.json());
+ jsonData = await data.json();
})
@@ -28,9 +24,8 @@
Station:
-{#each jsonData.trainServices.service as item} -{item.operator}
-{/each} + +{JSON.stringify(jsonData)}
\ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 9bbad96..d3dc24c 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -3,12 +3,10 @@ import adapter from '@sveltejs/adapter-static'; export default { kit: { adapter: adapter({ - // default options are shown. On some platforms - // these options are set automatically — see below pages: 'build', assets: 'build', fallback: undefined, - precompress: false, + precompress: true, strict: true }) }