From bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 14 Aug 2025 22:31:32 +0900 Subject: feat(backend,frontend): Replace hard-coded base path with environment variable --- frontend/app/api/client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'frontend/app/api/client.ts') 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({ 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) { -- cgit v1.2.3-70-g09d2