Files
sapper/test/apps/errors/src/routes/blog/[slug].html
2019-01-30 10:21:55 -05:00

21 lines
351 B
HTML

<script context="module">
export function preload({ params }) {
const { slug } = params;
return this.fetch(`blog/${slug}.json`).then(r => {
return r.json().then(data => {
if (r.status !== 200) {
this.error(r.status, data);
}
return data;
});
});
}
</script>
<script>
export let post;
</script>
<h1>{post.title}</h1>