Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

+server.ts

7 lines260 Bytes

1import { json } from '@sveltejs/kit'
2import type { RequestHandler } from './$types'
3import { getContacts } from '$lib/server/contacts'
4​
5export const GET: RequestHandler = async ({ url }) => {
6 return json(await getContacts(url.searchParams.get('q') ?? ''))
7}