mirror of
https://github.com/BradNut/personal-website-sveltekit
synced 2025-09-08 23:20:18 +00:00
16 lines
513 B
TypeScript
16 lines
513 B
TypeScript
import type { PageServerLoad } from './lib/$types';
|
|
import { PAGE_SIZE } from '$env/static/private';
|
|
import { fetchBandcampAlbums } from '$root/lib/util/fetchBandcampAlbums';
|
|
|
|
export const load: PageServerLoad = async ({ fetch, setHeaders }) => {
|
|
const albums = async () => await fetchBandcampAlbums();
|
|
const articles = async () => await fetch(`/api/articles?page=1&limit=3`);
|
|
|
|
setHeaders({
|
|
'cache-control': 'max-age=43200'
|
|
});
|
|
return {
|
|
albums: albums(),
|
|
articlesData: (await articles()).json()
|
|
};
|
|
};
|