uses map with elevation for edit mode

This commit is contained in:
Christian Beutel
2024-04-20 22:04:06 +02:00
parent 90e482dc59
commit 13f0f5ca8a
7 changed files with 62 additions and 141 deletions

View File

@@ -0,0 +1,16 @@
import { error, json, type RequestEvent } from "@sveltejs/kit";
import { env } from '$env/dynamic/public'
export async function POST(event: RequestEvent) {
const data = await event.request.json()
if(!env.PUBLIC_VALHALLA_URL) {
return error(400, "PUBLIC_VALHALLA_URL not set")
}
try {
const r = await event.fetch(env.PUBLIC_VALHALLA_URL + '/route', data);
return json(r);
} catch (e: any) {
throw error(e.status, e)
}
}