/** * ============================================================ * SVGarden — https://www.svgarden.dev * Author : Simon-Pierre Boucher * Contact: contact@spboucher.ai * File : src/pages/search-index.json.js * Desc : Build-time endpoint — Fuse.js search index for the whole bank * ============================================================ */ import { loadSnippets } from '../lib/snippets.mjs'; export async function GET() { const snippets = await loadSnippets(); const index = snippets.map((s) => ({ slug: s.slug, title: s.title, category: s.category, difficulty: s.difficulty, tags: s.tags, techniques: s.techniques, desc: s.desc, })); return new Response(JSON.stringify(index), { headers: { 'Content-Type': 'application/json' }, }); }