Some checks failed
Deploy / deploy (push) Failing after 39s
Co-authored-by: Benjamin Palko <benjaminpalko@hotmail.com> Reviewed-on: #5
17 lines
357 B
TypeScript
17 lines
357 B
TypeScript
import { logger } from '$lib/server/logger';
|
|
import { error } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
import { getPosts } from '$lib/posts';
|
|
|
|
export const load: PageServerLoad = async () => {
|
|
try {
|
|
const posts = await getPosts();
|
|
|
|
return {
|
|
posts
|
|
};
|
|
} catch (err) {
|
|
logger.error(err, 'Uh-oh!');
|
|
error(500);
|
|
}
|
|
};
|