From 00779b6515be36d0ef4127aea4e6dcede802da1a Mon Sep 17 00:00:00 2001 From: Daniel McCrystal Date: Sun, 17 Aug 2025 21:47:29 -0400 Subject: [PATCH] use the right url --- packages/client/src/api.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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;