MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / getBaseUrl

Function getBaseUrl

app/src/utils/api.ts:13–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import { type AppRouter } from "~/server/api/root.router";
12
13const getBaseUrl = () => {
14 if (typeof window !== "undefined") return ""; // browser should use relative url
15 if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`; // SSR should use vercel url
16 return `http://localhost:${process.env.PORT ?? 3000}`; // dev SSR should use localhost
17};
18
19/** A set of type-safe react-query hooks for your tRPC API. */
20export const api = createTRPCNext<AppRouter>({

Callers 1

configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected