| 12345678910111213141516171819202122 |
- import {PUBLIC_API_URL} from "$env/static/public";
- import {error} from "@sveltejs/kit";
- export async function load({fetch, request}){
- const res = await fetch(`${PUBLIC_API_URL}/game`, {
- method: "GET",
- headers: {
- "Content-Type": "application/json",
- Cookie: request.headers.get("cookie") ?? ""
- }
- });
- const data = await res.json();
- if(!res.ok){
- error(res.status, {
- message: data.error.message,
- back: "/"
- });
- }
- return {data};
- }
|