import { addVocab, readVocab, CURATED, COMPOUNDS } from "@/lib/vocab"; export const dynamic = "force-dynamic"; export async function GET() { return Response.json( { curated: CURATED, compounds: COMPOUNDS, custom: await readVocab() }, { headers: { "cache-control": "no-store" } }, ); } export async function POST(request: Request) { const { word } = (await request.json().catch(() => ({}))) as { word?: string }; if (!word?.trim()) return Response.json({ error: "word is required" }, { status: 400 }); return Response.json({ custom: await addVocab(word) }); }