Handle data loading during SSR

This commit is contained in:
Laurent
2024-10-27 18:02:59 +01:00
parent 29ed897de5
commit 7ae4bb346d
11 changed files with 46 additions and 17 deletions

View File

@@ -0,0 +1,10 @@
const api_url = import.meta.env.VITE_SERVER_API_URL
// @ts-ignore
export const load = async ( {fetch} ) => {
const res = await fetch(`${api_url}/leaderboard`)
const leaderboard = await res.json()
return { leaderboard };
}