Import initial : code en production sur Hetzner
This commit is contained in:
commit
cf6ee64e31
43 changed files with 14404 additions and 0 deletions
10
server/api/geocode.get.ts
Normal file
10
server/api/geocode.get.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { z } from 'zod'
|
||||
import type { Place } from '#shared/types'
|
||||
|
||||
const QuerySchema = z.object({ q: z.string().min(3).max(200) })
|
||||
|
||||
export default defineEventHandler(async (event): Promise<Place[]> => {
|
||||
const parsed = QuerySchema.safeParse(getQuery(event))
|
||||
if (!parsed.success) return []
|
||||
return searchPlaces(parsed.data.q)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue