Skip to content

Commit

Permalink
fix: rest api host url
Browse files Browse the repository at this point in the history
  • Loading branch information
drochetti committed Nov 2, 2023
1 parent 698b95a commit 2d77e5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/client/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<InitiateUploadResult> {
return await dispatchRequest<InitiateUploadData, InitiateUploadResult>(
'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',
Expand Down

0 comments on commit 2d77e5d

Please sign in to comment.