mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
14 lines
424 B
TypeScript
14 lines
424 B
TypeScript
import { queryCollection } from '@nuxt/content/server'
|
|
|
|
export default defineCachedEventHandler(async (event) => {
|
|
// Use the same approach as /pages/components.vue
|
|
return await queryCollection(event, 'docs')
|
|
.where('path', 'LIKE', '%/components/%')
|
|
.where('extension', '=', 'md')
|
|
.select('path', 'title', 'description', 'category')
|
|
.all()
|
|
}, {
|
|
name: 'mcp-list-components',
|
|
maxAge: 3600 // 1 hour
|
|
})
|