mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 18:59:59 +01:00
17 lines
388 B
TypeScript
17 lines
388 B
TypeScript
import { queryCollection } from '@nuxt/content/server'
|
|
|
|
export default defineCachedEventHandler(async (event) => {
|
|
const result = await queryCollection(event, 'profile')
|
|
.where('extension', '=', 'md')
|
|
.first()
|
|
|
|
if (!result) {
|
|
throw createError({ statusCode: 404, statusMessage: 'Profile not found' })
|
|
}
|
|
|
|
return result
|
|
}, {
|
|
maxAge: 60 * 60 * 24,
|
|
name: 'profile'
|
|
})
|