diff --git a/web/lib/firebase/api-call.ts b/web/lib/firebase/api-call.ts index d46b3afa..7509a9f1 100644 --- a/web/lib/firebase/api-call.ts +++ b/web/lib/firebase/api-call.ts @@ -41,8 +41,13 @@ export async function call(url: string, method: string, params: any) { // one less hop export function getFunctionUrl(name: string) { - const { cloudRunId, cloudRunRegion } = ENV_CONFIG - return `https://${name}-${cloudRunId}-${cloudRunRegion}.a.run.app` + if (process.env.NEXT_PUBLIC_FIREBASE_EMULATE) { + const { projectId, region } = ENV_CONFIG.firebaseConfig + return `http://localhost:5001/${projectId}/${region}/${name}` + } else { + const { cloudRunId, cloudRunRegion } = ENV_CONFIG + return `https://${name}-${cloudRunId}-${cloudRunRegion}.a.run.app` + } } export function createMarket(params: any) {