diff --git a/packages/client/src/api.ts b/packages/client/src/api.ts index ca532c2..c881bd8 100644 --- a/packages/client/src/api.ts +++ b/packages/client/src/api.ts @@ -1,7 +1,10 @@ import { type Api } from "../../server/src/api"; import { treaty } from "@elysiajs/eden"; -const { api } = treaty("http://localhost:5001", { - fetch: { credentials: "include" }, -}); +const { api } = treaty( + import.meta.env.DEV ? "http://localhost:5001" : window.location.origin, + { + fetch: { credentials: "include" }, + } +); export default api;