Point v2 functions @ localhost during emulation (#597)
This commit is contained in:
parent
7bbc425690
commit
2fbbc66029
|
@ -41,9 +41,14 @@ export async function call(url: string, method: string, params: any) {
|
||||||
// one less hop
|
// one less hop
|
||||||
|
|
||||||
export function getFunctionUrl(name: string) {
|
export function getFunctionUrl(name: string) {
|
||||||
|
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
|
const { cloudRunId, cloudRunRegion } = ENV_CONFIG
|
||||||
return `https://${name}-${cloudRunId}-${cloudRunRegion}.a.run.app`
|
return `https://${name}-${cloudRunId}-${cloudRunRegion}.a.run.app`
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function createMarket(params: any) {
|
export function createMarket(params: any) {
|
||||||
return call(getFunctionUrl('createmarket'), 'POST', params)
|
return call(getFunctionUrl('createmarket'), 'POST', params)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user