import { autocomplete } from "@/lib/public/queries"; export const dynamic = "force-dynamic"; export async function GET(req: Request) { const q = new URL(req.url).searchParams.get("q") ?? ""; if (q.length > 100) return Response.json([], { status: 400 }); const hits = await autocomplete(q); return Response.json(hits, { headers: { "cache-control": "public, max-age=60, s-maxage=300" } }); }