This commit is contained in:
2025-03-30 11:33:38 +02:00
parent 681115e291
commit 4009c44841
34 changed files with 726 additions and 146 deletions
+1 -6
View File
@@ -14,6 +14,7 @@ import SuperJSON from "superjson";
import { type AppRouter } from "@/server/api/root";
import { createQueryClient } from "./query-client";
import { getBaseUrl } from "@/lib/utils";
let clientQueryClientSingleton: QueryClient | undefined = undefined;
const getQueryClient = () => {
@@ -84,9 +85,3 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) {
</QueryClientProvider>
);
}
function getBaseUrl() {
if (typeof window !== "undefined") return window.location.origin;
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`;
return `http://localhost:${process.env.PORT ?? 3000}`;
}