Files
stream.graff.tech-client/src/landing/lib/api.ts
T

16 lines
349 B
TypeScript

import ky from "ky";
function str(v: unknown): string {
return typeof v === "string" ? v.trim() : "";
}
const raw = str(import.meta.env.VITE_API_URL);
const base = raw ? raw.replace(/\/?$/, "/") : "";
export const hasApiConfigured = base.length > 0;
export const api = ky.create({
prefixUrl: base || undefined,
credentials: "include",
});