8 lines
188 B
TypeScript
8 lines
188 B
TypeScript
import type { Post } from '$lib/types'
|
|
|
|
export async function load({ fetch }) {
|
|
const response = await fetch('api/posts')
|
|
const posts: Post[] = await response.json()
|
|
return { posts }
|
|
}
|