diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-14 22:31:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-14 22:44:16 +0900 |
| commit | bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700 (patch) | |
| tree | e8d6eaeab9ae28f1c66e530cbeed483db08a7098 /frontend/app/api/client.ts | |
| parent | 948d7e6596bc4a37c8d7903e785e099b6a81a664 (diff) | |
| download | iosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.tar.gz iosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.tar.zst iosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.zip | |
feat(backend,frontend): Replace hard-coded base path with environment variable
Diffstat (limited to 'frontend/app/api/client.ts')
| -rw-r--r-- | frontend/app/api/client.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/app/api/client.ts b/frontend/app/api/client.ts index ee5437d..6fa784f 100644 --- a/frontend/app/api/client.ts +++ b/frontend/app/api/client.ts @@ -1,12 +1,13 @@ import createClient from "openapi-fetch"; import { createContext } from "react"; +import { API_BASE_PATH } from "../config"; import type { paths } from "./schema"; const client = createClient<paths>({ baseUrl: process.env.NODE_ENV === "development" - ? "http://localhost:8003/phperkaigi/2025/code-battle/api/" - : "https://t.nil.ninja/phperkaigi/2025/code-battle/api/", + ? `http://localhost:8003${API_BASE_PATH}` + : `https://t.nil.ninja${API_BASE_PATH}`, }); export async function apiLogin(username: string, password: string) { |
