9 lines
306 B
TypeScript
9 lines
306 B
TypeScript
import { getDocWithNav } from '../../utils/content';
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const slug = getRouterParam(event, 'slug')!;
|
|
const result = await getDocWithNav(slug);
|
|
if (!result) throw createError({ statusCode: 404, statusMessage: 'Doc not found' });
|
|
return result;
|
|
});
|