Need help building application with SSR.
It seems the build guide is outdated. I've gone ahead and added the compatability flag, but do other things need to be set? What is my next.config.json supposed to look like?
const ImageCardPage = ({exploreImage}) => {
const router = useRouter();
const {id} = router.query;
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
const handleModalClose = () => {
router.push('/');
};
console.log("NEXT API URL: ", process.env.NEXT_PUBLIC_API_URL)
console.log("EXPLORE IMAGE: ", exploreImage)
return (
isMobile ? <MobileDetailedImageCard
exploreImageId={id}
exploreImage={exploreImage}
closeModal={handleModalClose}
/> :
<DetailedImageCard
exploreImageId={id}
exploreImage={exploreImage}
closeModal={handleModalClose}
/>
);
}
export default ImageCardPage;
export async function getServerSideProps({params}) {
const imageData = await exploreService.getExploreImage(params.id);
return {
props: {
exploreImage: imageData
}
};
}
export const runtime = 'experimental-edge';export const config = { runtime: 'experimental-edge' };