From 2d77e5d932f80a1cfd3f4073fd8c5fe675ec4b13 Mon Sep 17 00:00:00 2001 From: Daniel Rochetti Date: Thu, 2 Nov 2023 10:35:31 -0700 Subject: [PATCH] fix: rest api host url --- libs/client/src/storage.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/client/src/storage.ts b/libs/client/src/storage.ts index 5229500..98b70f3 100644 --- a/libs/client/src/storage.ts +++ b/libs/client/src/storage.ts @@ -50,10 +50,15 @@ type InitiateUploadData = { content_type: string | null; }; +function getRestApiUrl(): string { + const { host } = getConfig(); + return host.replace('gateway', 'rest'); +} + async function initiateUpload(file: Blob): Promise { return await dispatchRequest( 'POST', - 'https://rest.daniel.shark.fal.ai/storage/upload/initiate', + `https://${getRestApiUrl()}/storage/upload/initiate`, { file_name: file.name, content_type: file.type || 'application/octet-stream',