-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60d2672
commit 4a8f792
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,26 @@ | ||
<!-- <h1>Welcome to SvelteKit</h1> | ||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> --> | ||
|
||
<script> | ||
import { onMount } from 'svelte'; | ||
let backendData = ''; | ||
onMount(async () => { | ||
try { | ||
const response = await fetch('https://novasystem-backend-5bc4a8329298.herokuapp.com/'); | ||
backendData = await response.text(); | ||
} catch (error) { | ||
console.error('Error fetching data from the backend:', error); | ||
} | ||
}); | ||
</script> | ||
|
||
<h1>Welcome to SvelteKit</h1> | ||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> | ||
|
||
{#if backendData} | ||
<p>Data from the backend: {backendData}</p> | ||
{:else} | ||
<p>Loading data from the backend...</p> | ||
{/if} |