diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
| commit | b450648caa0d1bd5c91e67a33153bbacaf57f006 (patch) | |
| tree | 8dce01b8eb398759a3abdb97d3d333b52738c768 /frontend | |
| parent | a7342525e5e4052113e6d5e75b6fd50c91687514 (diff) | |
| download | iosdc-japan-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.gz iosdc-japan-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.zst iosdc-japan-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.zip | |
feat: prepend base path
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/app/.server/api/client.ts | 4 | ||||
| -rw-r--r-- | frontend/app/components/GolfPlayApp.client.tsx | 5 | ||||
| -rw-r--r-- | frontend/app/components/GolfWatchApp.client.tsx | 5 | ||||
| -rw-r--r-- | frontend/app/routes/dashboard.tsx | 4 | ||||
| -rw-r--r-- | frontend/vite.config.ts | 1 |
5 files changed, 9 insertions, 10 deletions
diff --git a/frontend/app/.server/api/client.ts b/frontend/app/.server/api/client.ts index aae1723..1c96b7b 100644 --- a/frontend/app/.server/api/client.ts +++ b/frontend/app/.server/api/client.ts @@ -4,8 +4,8 @@ import type { paths } from "./schema"; const apiClient = createClient<paths>({ baseUrl: process.env.NODE_ENV === "development" - ? "http://localhost:8002/api/" - : "http://api-server/api/", + ? "http://localhost:8002/iosdc-japan/2024/code-battle/api/" + : "http://api-server/iosdc-japan/2024/code-battle/api/", }); export async function apiPostLogin( diff --git a/frontend/app/components/GolfPlayApp.client.tsx b/frontend/app/components/GolfPlayApp.client.tsx index 911fae0..43828e6 100644 --- a/frontend/app/components/GolfPlayApp.client.tsx +++ b/frontend/app/components/GolfPlayApp.client.tsx @@ -22,11 +22,10 @@ export default function GolfPlayApp({ game: Game; sockToken: string; }) { - // const socketUrl = `wss://t.nil.ninja/iosdc-japan/2024/sock/golf/${game.game_id}/play?token=${sockToken}`; const socketUrl = process.env.NODE_ENV === "development" - ? `ws://localhost:8002/sock/golf/${game.game_id}/play?token=${sockToken}` - : `ws://api-server/sock/golf/${game.game_id}/play?token=${sockToken}`; + ? `ws://localhost:8002/iosdc-japan/2024/code-battle/sock/golf/${game.game_id}/play?token=${sockToken}` + : `wss://t.nil.ninja/iosdc-japan/2024/code-battle/sock/golf/${game.game_id}/play?token=${sockToken}`; const { sendJsonMessage, lastJsonMessage, readyState } = useWebSocket<WebSocketMessage>(socketUrl, {}); diff --git a/frontend/app/components/GolfWatchApp.client.tsx b/frontend/app/components/GolfWatchApp.client.tsx index aefe945..829f709 100644 --- a/frontend/app/components/GolfWatchApp.client.tsx +++ b/frontend/app/components/GolfWatchApp.client.tsx @@ -20,11 +20,10 @@ export default function GolfWatchApp({ game: Game; sockToken: string; }) { - // const socketUrl = `wss://t.nil.ninja/iosdc-japan/2024/sock/golf/${game.game_id}/watch?token=${sockToken}`; const socketUrl = process.env.NODE_ENV === "development" - ? `ws://localhost:8002/sock/golf/${game.game_id}/watch?token=${sockToken}` - : `ws://api-server/sock/golf/${game.game_id}/watch?token=${sockToken}`; + ? `ws://localhost:8002/iosdc-japan/2024/code-battle/sock/golf/${game.game_id}/watch?token=${sockToken}` + : `wss://t.nil.ninja/iosdc-japan/2024/code-battle/sock/golf/${game.game_id}/watch?token=${sockToken}`; const { lastJsonMessage, readyState } = useWebSocket<WebSocketMessage>( socketUrl, diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx index e6a43de..d69018a 100644 --- a/frontend/app/routes/dashboard.tsx +++ b/frontend/app/routes/dashboard.tsx @@ -13,8 +13,8 @@ export async function loader({ request }: LoaderFunctionArgs) { if (user.is_admin) { return redirect( process.env.NODE_ENV === "development" - ? "http://localhost:8002/admin/dashboard" - : "/admin/dashboard", + ? "http://localhost:8002/iosdc-japan/2024/code-battle/admin/dashboard" + : "/iosdc-japan/2024/code-battle/admin/dashboard", ); } const { games } = await apiGetGames(token); diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index e07fb91..bb04554 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -10,6 +10,7 @@ export default defineConfig({ v3_relativeSplatPath: true, v3_throwAbortReason: true, }, + basename: "/iosdc-japan/2024/code-battle/", }), tsconfigPaths(), ], |
