Files

16 lines
341 B
TypeScript
Raw Permalink Normal View History

2026-02-13 15:52:13 +07:00
import { treaty } from "@elysiajs/eden";
import type { App } from "@minikura/backend";
2026-08-13 01:57:48 +07:00
const baseUrl =
typeof window === "undefined"
? process.env.API_URL || "http://localhost:3000"
: window.location.origin;
2026-02-13 15:52:13 +07:00
export const api = treaty<App>(baseUrl, {
fetch: {
credentials: "include",
},
});
export type Api = typeof api;