From c3c90d575182d64b0e679e8da81a6d4f3559cf1f Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Tue, 28 Mar 2023 19:26:30 +0200 Subject: Working app --- pages/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/index.js (limited to 'pages/index.js') diff --git a/pages/index.js b/pages/index.js new file mode 100644 index 0000000..9974583 --- /dev/null +++ b/pages/index.js @@ -0,0 +1,20 @@ +import Avatar from "../components/Avatar" + +export default function Avs(props) { + return ( + <> +

Avatars

+ {props.avs.map(data => )} + + ) +} + +export const getStaticProps = async () => { + const res = await fetch(`http://localhost:3000/api/avatars`); + const avs = await res.json(); + return { + props: { + avs + } + } +} -- cgit v1.3.1