Skip to content

Commit 2a76539

Browse files
authored
Added support for calling Eventarc emulator (#1686)
1 parent c21112e commit 2a76539

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/eventarc/eventarc-client-internal.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class EventarcApiClient {
102102
}
103103
const request: HttpRequestConfig = {
104104
method: 'POST',
105-
url: `${EVENTARC_API}/${channel}:publishEvents`,
105+
url: `${this.getEventarcHost()}/${channel}:publishEvents`,
106106
data: JSON.stringify({ events }),
107107
};
108108
return this.sendRequest(request);
@@ -153,4 +153,8 @@ export class EventarcApiClient {
153153
const projectId = await this.getProjectId();
154154
return `projects/${projectId}/locations/${location}/channels/${channelId}`;
155155
}
156+
157+
private getEventarcHost(): string {
158+
return process.env.CLOUD_EVENTARC_EMULATOR_HOST ?? EVENTARC_API;
159+
}
156160
}

0 commit comments

Comments
 (0)