diff --git a/client/src/app/game/[code]/not-found.tsx b/client/src/app/[code]/not-found.tsx
similarity index 56%
rename from client/src/app/game/[code]/not-found.tsx
rename to client/src/app/[code]/not-found.tsx
index d49494f..296afd6 100644
--- a/client/src/app/game/[code]/not-found.tsx
+++ b/client/src/app/[code]/not-found.tsx
@@ -1,8 +1,8 @@
export default function NotFound() {
return (
-
Error
-
Game not found
+
Error 404
+
Not found
);
}
diff --git a/client/src/app/game/[code]/page.tsx b/client/src/app/[code]/page.tsx
similarity index 95%
rename from client/src/app/game/[code]/page.tsx
rename to client/src/app/[code]/page.tsx
index b8d87c3..934f458 100644
--- a/client/src/app/game/[code]/page.tsx
+++ b/client/src/app/[code]/page.tsx
@@ -20,7 +20,7 @@ export async function generateMetadata({ params }: { params: { code: string } })
openGraph: {
title: "chessu",
description: `Play or watch a game with ${game.host?.name}`,
- url: `https://ches.su/game/${game.code}`,
+ url: `https://ches.su/${game.code}`,
siteName: "chessu",
locale: "en_US",
type: "website"
diff --git a/client/src/app/game/page.tsx b/client/src/app/game/page.tsx
deleted file mode 100644
index 12560fb..0000000
--- a/client/src/app/game/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { redirect } from "next/navigation";
-
-export default function GameEmpty() {
- redirect("/");
-}
diff --git a/client/src/components/game/GamePage.tsx b/client/src/components/game/GamePage.tsx
index d14d30c..df4c398 100644
--- a/client/src/components/game/GamePage.tsx
+++ b/client/src/components/game/GamePage.tsx
@@ -362,7 +362,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) {
}
function copyInvite() {
- const text = `https://ches.su/game/${initialLobby.code}`;
+ const text = `https://ches.su/${initialLobby.code}`;
if ("clipboard" in navigator) {
navigator.clipboard.writeText(text);
} else {
@@ -526,7 +526,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) {
onClick={copyInvite}
>
- ches.su/game/{initialLobby.code}
+ ches.su/{initialLobby.code}
copied to clipboard
diff --git a/client/src/components/home/CreateGame.tsx b/client/src/components/home/CreateGame.tsx
index 41dd306..ab6090d 100644
--- a/client/src/components/home/CreateGame.tsx
+++ b/client/src/components/home/CreateGame.tsx
@@ -24,7 +24,7 @@ export default function CreateGame() {
const game = await createGame(startingSide, unlisted.checked);
if (game) {
- router.push(`/game/${game.code}`);
+ router.push(`/${game.code}`);
} else {
setButtonLoading(false);
// TODO: Show error message
diff --git a/client/src/components/home/JoinGame.tsx b/client/src/components/home/JoinGame.tsx
index 824caab..34f2a32 100644
--- a/client/src/components/home/JoinGame.tsx
+++ b/client/src/components/home/JoinGame.tsx
@@ -31,7 +31,7 @@ export default function JoinGame() {
const game = await getGame(code);
if (game && game.code) {
- router.push(`/game/${game.code}`);
+ router.push(`/${game.code}`);
} else {
setButtonLoading(false);
setNotFound(true);
diff --git a/client/src/components/home/PublicGames/JoinButton.tsx b/client/src/components/home/PublicGames/JoinButton.tsx
index 1f3a866..b94cd3e 100644
--- a/client/src/components/home/PublicGames/JoinButton.tsx
+++ b/client/src/components/home/PublicGames/JoinButton.tsx
@@ -9,7 +9,7 @@ export default function JoinButton({ code }: { code: string }) {
function handleJoin() {
startTransition(() => {
- router.push(`/game/${code}`);
+ router.push(`/${code}`);
});
}