Point v2 functions @ localhost during emulation (#597)
This commit is contained in:
parent
7bbc425690
commit
2fbbc66029
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user