Retrieving data from an API route. #9656
Replies: 1 comment
-
This is completely fine. Alternatively, you can just do it in one
You shouldn't need one. The
I don't think it is, although I'm definitely not an expert myself. You could try using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm learning SvelteKit and Supabase together. Here is my project structure:
I aim to display a substantial amount of data on the frontpage with pagination, preloading the initial pages before rendering. Also, I want to ensure that users cannot access my database or API routes directly (e.g. typing
/api/xxx
in the browser will redirect to the frontpage).My app works well so far, but I am unsure about a few things:
+server.js
and using the load function in+page.js
) is the appropriate pattern to follow in SvelteKit.+page.svelte
file for each nested API route in order for the redirect helper to function correctly.Beta Was this translation helpful? Give feedback.
All reactions