I have a Java Spring API i want to get data from , and display them in my component eg. Test.svelte i use in my +layout.svelte . I dont want to have a fetch directly to the Api But the svelte application first .
User (Test.svelte) <-> SvelteApplication <-> API
What is the correct way to do this ?
I Have tried using the accepted approach here
Create a svelte component with a function recive a data by post
By creating a Test.js but it dosent seem to ever fetch data (Tried logging in console) and my variables stay as undefined .