SPB Git
398 B · 9 lines typescript
1import { autocomplete } from "@/lib/public/queries";2export const dynamic = "force-dynamic";3export async function GET(req: Request) {4  const q = new URL(req.url).searchParams.get("q") ?? "";5  if (q.length > 100) return Response.json([], { status: 400 });6  const hits = await autocomplete(q);7  return Response.json(hits, { headers: { "cache-control": "public, max-age=60, s-maxage=300" } });8}9
Files · laptop-initial-20261102
Menu

Theme