17 lines
387 B
TypeScript
17 lines
387 B
TypeScript
import type { PageLoad } from "./$types";
|
|
|
|
export const load: PageLoad = async ({ fetch }) => {
|
|
const response = await fetch('map-index.json');
|
|
|
|
if (!response.ok) {
|
|
return { maps: [] };
|
|
}
|
|
|
|
const maps = await response.json();
|
|
|
|
return {
|
|
maps: maps.sort((a: any, b: any) => {
|
|
return Number(a.routeId) - Number(b.routeId);
|
|
})
|
|
};
|
|
}; |