import Link from "next/link"; // Fonction pour récupérer tous les projets depuis l'API Strapi async function getAllprojects() { try { const response = await fetch("http://localhost:1337/api/projects?populate=*"); if (!response.ok) { throw new Error("Failed to fetch projects"); } const projects = await response.json(); return projects.data; } catch (error) { console.error("Error fetching projects:", error); return []; } } // Composant principal de la page des projets export default async function Page() { const projects = await getAllprojects(); return (
{project.name}
{/* Affichage de la description du projet */}{project.description}