use the right url

This commit is contained in:
2025-08-17 21:47:29 -04:00
parent e58b702bc4
commit 00779b6515

View File

@@ -1,7 +1,10 @@
import { type Api } from "../../server/src/api";
import { treaty } from "@elysiajs/eden";
const { api } = treaty<Api>("http://localhost:5001", {
fetch: { credentials: "include" },
});
const { api } = treaty<Api>(
import.meta.env.DEV ? "http://localhost:5001" : window.location.origin,
{
fetch: { credentials: "include" },
}
);
export default api;