import Image from "next/image"; async function getData( url: string ) { const res = await fetch( url ); // The return value is *not* serialized // You can return Date, Map, Set, etc. if (!res.ok) { // This will activate the closest `error.js` Error Boundary throw new Error('Failed to fetch data'); } return res.json() } export default async function Home() { const data = await getData( "http://localhost:4000/questions" ); return (
{ data.map( (item: any) => (

{ item.question }

) ) }
); }