11 lines
274 B
TypeScript
11 lines
274 B
TypeScript
|
import { H3Error } from 'h3';
|
||
|
import { readBlogPost } from '~~/lib/blog/read-posts';
|
||
|
|
||
|
export default defineEventHandler(async (event) => {
|
||
|
const slug = getRouterParam(event, 'slug');
|
||
|
try {
|
||
|
const post = await readBlogPost(slug);
|
||
|
return post;
|
||
|
} catch (e) {}
|
||
|
});
|