Temporary fix to ldb page to allow test build
This commit is contained in:
parent
f45499b829
commit
b61b110c0b
@ -10,17 +10,13 @@
|
|||||||
return new URLSearchParams(window.location.search).get('station');
|
return new URLSearchParams(window.location.search).get('station');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {any[]}
|
|
||||||
*/
|
|
||||||
let jsonData = [] // Extract train data from the object to pass to #each
|
let jsonData = [] // Extract train data from the object to pass to #each
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const station = await getHeadcode();
|
const station = await getHeadcode();
|
||||||
document.getElementById('station').textContent = station;
|
document.getElementById('station').textContent = station;
|
||||||
const data = await fetch(`https://owlboard.info/api/v1/ldb/${station}`);
|
const data = await fetch(`https://owlboard.info/api/v1/ldb/${station}`);
|
||||||
const jsonData = await data.json()['GetStationBoardResult'];
|
jsonData = await data.json();
|
||||||
//document.getElementById('data_raw').textContent = JSON.stringify(await data.json());
|
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -28,9 +24,8 @@
|
|||||||
<Header {title} />
|
<Header {title} />
|
||||||
|
|
||||||
<p>Station: <span id="station"></span></p>
|
<p>Station: <span id="station"></span></p>
|
||||||
{#each jsonData.trainServices.service as item}
|
|
||||||
<p>{item.operator}</p>
|
<p>{JSON.stringify(jsonData)}</p>
|
||||||
{/each}
|
|
||||||
|
|
||||||
|
|
||||||
<Nav />
|
<Nav />
|
@ -3,12 +3,10 @@ import adapter from '@sveltejs/adapter-static';
|
|||||||
export default {
|
export default {
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
// default options are shown. On some platforms
|
|
||||||
// these options are set automatically — see below
|
|
||||||
pages: 'build',
|
pages: 'build',
|
||||||
assets: 'build',
|
assets: 'build',
|
||||||
fallback: undefined,
|
fallback: undefined,
|
||||||
precompress: false,
|
precompress: true,
|
||||||
strict: true
|
strict: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user