switches to nominatim

This commit is contained in:
Christian Beutel
2025-01-25 17:03:29 +01:00
parent ae5c0f8f62
commit eda94f3003
25 changed files with 526 additions and 179 deletions

View File

@@ -0,0 +1,17 @@
import { env } from "$env/dynamic/private";
import { error, json, type RequestEvent } from "@sveltejs/kit";
export async function POST(event: RequestEvent) {
const data = await event.request.json()
try {
const r = await event.fetch(`${env.NOMINATIM_URL}/search?q=${data.q}&format=geocodejson&limit=${data.limit}`)
return json(r);
} catch (e: any) {
console.log(e);
throw error(e.httpStatus, e)
}
}