diff --git a/frontend/src/pages/player.astro b/frontend/src/pages/player.astro new file mode 100644 index 0000000..9d025ea --- /dev/null +++ b/frontend/src/pages/player.astro @@ -0,0 +1,19 @@ +--- +import type { APIResponse, Player } from "../types"; + +const res = await fetch("http://localhost:3000/player"); +const data: APIResponse = await res.json(); +console.log(data); +--- + +
+ { + data.success && + data.data.map((player) => ( +
+ {player.name} +
+ )) + } + {!data.success &&
{data.message}
} +
diff --git a/frontend/src/pages/player/[name].astro b/frontend/src/pages/player/[name].astro new file mode 100644 index 0000000..14ce6cc --- /dev/null +++ b/frontend/src/pages/player/[name].astro @@ -0,0 +1,7 @@ +--- +const { name } = Astro.params; +--- + +
+

Hello {name}!

+