mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-03-16 07:09:20 +01:00
- Added evlog and nuxthub dependencies in nuxt.config.ts and package.json. - Implemented logging in various API endpoints (activity, contact, education, experiences, languages, projects, skills, stats, status-page, resumes) to track data retrieval and errors. - Enhanced error handling in Wakatime fetch functions to log errors with additional context. - Updated worker-configuration.d.ts to remove eslint-disable comments for better code quality.
19 lines
462 B
TypeScript
19 lines
462 B
TypeScript
import { queryCollection } from '@nuxt/content/server'
|
|
|
|
export default defineCachedEventHandler(async (event) => {
|
|
const log = useLogger(event)
|
|
const result = await queryCollection(event, 'skills')
|
|
.where('extension', '=', 'json')
|
|
.first()
|
|
|
|
if (!result) {
|
|
throw createError({ statusCode: 404, statusMessage: 'Skills not found' })
|
|
}
|
|
|
|
log.set({ skills: { found: true } })
|
|
return result.body
|
|
}, {
|
|
maxAge: 60 * 60 * 24,
|
|
name: 'skills'
|
|
})
|