uses map with elevation for edit mode
This commit is contained in:
16
web/src/routes/api/v1/valhalla/+server.ts
Normal file
16
web/src/routes/api/v1/valhalla/+server.ts
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user