10 lines
252 B
TypeScript
10 lines
252 B
TypeScript
import { getBlogPost } from '~~/lib/blog/read-posts';
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const slug = getRouterParam(event, 'slug');
|
|
try {
|
|
const post = await getBlogPost(slug as string);
|
|
return post;
|
|
} catch (e) {}
|
|
});
|