getStaticPaths method:
export const getStaticPaths: GetStaticPaths = async () => {
let ed = await fetch(`${baseURL}getEvents2`, {
method: "post",
});
let events = await ed.json();
const paths = ["hu", "en"].flatMap((lang) =>
events.map((eventId) => ({
params: { lang: lang, eventId: eventId },
}))
);
return {
paths,
fallback: true,
};
};
getStaticProps:
export const getStaticProps: GetStaticProps = async ({ ...context }) => {
console.log(context);
}
console.log output:
I would like to see the lang somehow in the context. How could I achieve this?
