Skip to content

Commit

Permalink
feat: Add s3 helper to get the bucket url
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Oct 16, 2024
1 parent d8da159 commit 46244a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './analytics';
export * from './analytics/types';
export * from './ipc/types';
export * from './helpers';
export * from './s3/helpers';
5 changes: 5 additions & 0 deletions packages/shared/src/s3/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function getBucketURL(): string {
return import.meta.env.VITE_AWS_S3_ENDPOINT
? `${import.meta.env.VITE_AWS_S3_ENDPOINT}/${import.meta.env.VITE_AWS_S3_BUCKET}`
: `https://${import.meta.env.VITE_AWS_S3_BUCKET}.s3.amazonaws.com`;
}

0 comments on commit 46244a7

Please sign in to comment.