import { GetServerSidePropsResult, InferGetServerSidePropsType } from 'next'; import API_BASE_URL from '../lib/consts/API_BASE_URL'; import fetchJSON from '../lib/fetchers/fetchJSON'; export async function getServerSideProps(): Promise< GetServerSidePropsResult > { return { props: await fetchJSON(`${API_BASE_URL}/api/anvils`), }; } function DemoAnvilList({ anvils, }: InferGetServerSidePropsType): JSX.Element { return (

Demo Anvil List

anvils

{JSON.stringify(anvils, null, 4)}
); } export default DemoAnvilList;