feat: add GPX file handling and GeoJSON integration in adventure page; update dependencies and AttachmentCard component

This commit is contained in:
Sean Morley
2025-01-20 20:03:00 -05:00
parent 30c58ca118
commit 64d2bdebce
6 changed files with 131 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
const endpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
/** @type {import('./$types').RequestHandler} */
export async function GET(event) {
let sessionid = event.cookies.get('sessionid');
let fileName = event.params.file;
let res = await fetch(`${endpoint}/media/attachments/${fileName}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Cookie: `sessionid=${sessionid}`
}
});
let data = await res.text();
return new Response(data, {
status: res.status,
headers: {
'Content-Type': 'application/xml'
}
});
}