From d844648e7da928e326940cb5505bf2fbccf93e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Fri, 11 Dec 2020 01:38:05 +0100 Subject: [PATCH] Edit HomePage --- pages/index.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pages/index.js b/pages/index.js index 453d799..02cc862 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,9 +1,23 @@ -import {Button} from '@material-ui/core' +import axios from 'axios' + +import Navigasyon from '../components/navigasyon' export default function Home() { return ( - + ) } + +export async function getServerSideProps() { + const mizikResponse = await axios.get(`${process.env.API_URL}/mizik`) + const awtisResponse = await axios.get(`${process.env.API_URL}/awtis`) + const mizik = mizikResponse.data + const awtis = awtisResponse.data + + return { + props: { + mizik, + awtis + } + } +}