aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/api/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/api/client.ts')
-rw-r--r--frontend/app/api/client.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/app/api/client.ts b/frontend/app/api/client.ts
index 6b7ce80..c26f1c6 100644
--- a/frontend/app/api/client.ts
+++ b/frontend/app/api/client.ts
@@ -3,11 +3,11 @@ import { createContext } from "react";
import { API_BASE_PATH } from "../config";
import type { paths } from "./schema";
+const apiOrigin = import.meta.env.VITE_API_BASE_URL
+ ?? (import.meta.env.DEV ? "http://localhost:8004" : "");
+
const client = createClient<paths>({
- baseUrl:
- process.env.NODE_ENV === "development"
- ? `http://localhost:8004${API_BASE_PATH}`
- : `https://t.nil.ninja${API_BASE_PATH}`,
+ baseUrl: `${apiOrigin}${API_BASE_PATH}`,
});
export async function apiLogin(username: string, password: string) {