pages
This commit is contained in:
parent
ee267bf62a
commit
e0df9ed858
11 changed files with 206 additions and 35 deletions
|
|
@ -1,19 +1,4 @@
|
|||
export async function getServerSideProps({ res }) {
|
||||
res.setHeader("Cache-Control", "public, s-maxage=10, stale-while-revalidate=59")
|
||||
const response = await fetch("http://localhost:3000/api/players", {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
const allPlayers = await response.json()
|
||||
|
||||
return {
|
||||
props: { allPlayers },
|
||||
}
|
||||
}
|
||||
|
||||
export default function Web({ allPlayers }) {
|
||||
export default function Web() {
|
||||
return (
|
||||
<>
|
||||
<section>
|
||||
|
|
@ -22,9 +7,6 @@ export default function Web({ allPlayers }) {
|
|||
<h1 className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight md:text-5xl xl:text-6xl">
|
||||
IsaCon
|
||||
</h1>
|
||||
{allPlayers.data.map((player) => (
|
||||
<div key={player.id}>{player.name}</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue