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',