/** @type {import('./$types').LayoutServerLoad} */
export async function load({ fetch }) {
    const response = await fetch("http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note", {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
        }
    });

    if (!response.ok) {
        throw new Error(`Es gab einen Fehler beim Laden der Notizen: ${response.statusText}`)
    }

    const data = await response.json();

    return {
        notes: data
    };
}