Skip to content

Commit 8356158

Browse files
committed
rendering all legacy content
1 parent ac56a5a commit 8356158

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

new/apps/web/src/routes/+page.server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { type ServerLoad } from '@sveltejs/kit';
33
export const prerender = false;
44

55
export const load: ServerLoad = async ({ fetch }) => {
6-
const res = await fetch('http://localhost:8080/widgets.php?file=files/test1.json');
7-
return { widgetResponse: await res.text() };
6+
const FILE_PATH = 'files/test1.json';
7+
const widgetHTML = await (await fetch(`http://localhost:8080/widgets.php?file=${FILE_PATH}`)).text();
8+
const tableHTML = await (await fetch('http://localhost:8080/tables.php/?file=files/test1.json')).text();
9+
const tabbedInfoHTML = await (await fetch('http://localhost:8080/tabbed_info.php/?file=files/test1.json')).text();
10+
return { widgetHTML, tableHTML, tabbedInfoHTML};
811
};

new/apps/web/src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
onMount(() => {
88
// console.log(data.widgetResponse);
99
const wrapperDiv = document.getElementById('legacy-content');
10-
wrapperDiv!.innerHTML = data.widgetResponse;
10+
wrapperDiv!.innerHTML = data.widgetHTML + data.tabbedInfoHTML + data.tableHTML;
1111
// document.appendChild(wrapperDiv);
1212
});
1313
</script>

0 commit comments

Comments
 (0)