Slide 10
Slide 10 text
-PBEؔʢ/FYUKTͷHFU4UBUJD1SPQT૬ͷͷʣ
export async function load({ page, fetch, session, stuff })
{
const url = `/blog/${page.params.slug}.json`
;
const res = await fetch(url)
;
if (res.ok)
{
return
{
props:
{
article: await res.json(
)
}
}
;
}
return
{
status: res.status
,
error: new Error(`Could not load ${url}`
)
}
;
}