// GET /api/clinics/search?q=…&limit=8 // Autocomplete over the Bundes-Klinik-Atlas Standorte (FTS5 prefix match). // Never exposes the clinic's own contact address — only what the picker needs. export default defineEventHandler((event) => { const query = getQuery(event) const q = String(query.q ?? '').trim() const limit = Math.max(1, Math.min(15, Number(query.limit ?? 8) || 8)) if (q.length < 2) { return { status: 200, query: q, count: 0, results: [] } } const results = searchClinics(q, limit).map((c) => publicClinic(c)) return { status: 200, query: q, count: results.length, results } })