Roadmap to becoming a developer in 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
662 B

import type { APIRoute } from 'astro';
export async function getStaticPaths() {
const roadmapJsons = await import.meta.glob('/src/data/roadmaps/**/*.json', {
eager: true,
});
return Object.keys(roadmapJsons).map((filePath) => {
const roadmapId = filePath.split('/').pop()?.replace('.json', '');
const roadmapJson = roadmapJsons[filePath] as Record<string, any>;
return {
params: {
roadmapId,
},
props: {
2 years ago
roadmapJson: roadmapJson?.default,
},
};
});
}
export const get: APIRoute = async function ({ params, request, props }) {
return {
body: JSON.stringify(props.roadmapJson),
};
};