diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f1409ef..11ea8bc 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -19,6 +19,21 @@ alert('Failed to create note'); } } + + let notes = []; + + async function fetchNotes() { + const response = await fetch('http://localhost:8069/notes'); + + if (response.ok) { + notes = await response.json(); + } else { + console.error('Failed to fetch notes'); + } + } + + // Fetch notes when the component is first rendered + fetchNotes(); @@ -32,4 +47,12 @@ - \ No newline at end of file + + + + + \ No newline at end of file