about page & load more button

This commit is contained in:
2024-06-23 19:32:19 +02:00
parent d269814488
commit f3bf7f6551
10 changed files with 95 additions and 22 deletions

View File

@@ -0,0 +1,12 @@
import { env } from '$lib';
import { error, json, text } from '@sveltejs/kit';
import { get } from 'svelte/store';
import { site_id } from '../store';
/** @type {import('./$types').RequestHandler} */
export async function GET({fetch, url}) {
const offset = url.searchParams.get("offset") || 0;
const postsRes = await fetch(env.api_url + `/blog?blog_id=${get(site_id)}&offset=${offset}`).then(x=>x.json());
return json(postsRes.articles);
}