diff --git a/apps/frontend/src/honoClient.ts b/apps/frontend/src/honoClient.ts index 7cbd554..f4a8186 100644 --- a/apps/frontend/src/honoClient.ts +++ b/apps/frontend/src/honoClient.ts @@ -1,7 +1,11 @@ import { hc } from "hono/client"; import { AppType } from "backend"; -const client = hc("http://localhost:3000", { +const backendUrl = import.meta.env.VITE_BACKEND_BASE_URL as string | undefined; + +if (!backendUrl) throw new Error("Backend URL not set"); + +const client = hc(backendUrl, { headers: { Authorization: `Bearer ${localStorage.getItem("accessToken")}`, },