14 lines
224 B
JavaScript
14 lines
224 B
JavaScript
|
import { getPost } from '$lib/pages';
|
||
|
|
||
|
export const get = async ({params}) => {
|
||
|
let post = await getPost(params.name);
|
||
|
if (post) {
|
||
|
return {
|
||
|
body: post
|
||
|
}
|
||
|
} else {
|
||
|
return {
|
||
|
status: 404
|
||
|
}
|
||
|
}
|
||
|
}
|