API
Use API in frontend
How to use the endpoint in your application depends on whether you want to call the endpoint on the server or on the client.
Svelte components
To call the endpoint from a Svelte component you need to create an api caller and call the endpoint like so:
Loading data via server
To call the endpoint in +page.server.ts
or +layout.server.ts
, create an apiCaller
and use the endpoint like: