import { cleanCategoryCard, getUrlWithProxiedParams } from '../../../runtime'; import type { IRawCategoryCard } from '../../../types'; export default defineEventHandler(async (event) => { const apiUrl = process.env.NUXT_PUBLIC_API_DOMAIN; const url = getUrlWithProxiedParams(`${apiUrl}/v1/categories/top-random`, event); const categories = await cachedApiFetch>(url, event); return categories.map(cleanCategoryCard); });