* Get the bucket URL to use in the returned file URL * @returns The bucket URL string
()
| 178 | * @returns The bucket URL string |
| 179 | */ |
| 180 | private getBucketUrl(): string { |
| 181 | const s3Config = this.configService.s3Config; |
| 182 | |
| 183 | // If a public URL is configured, use it (e.g., CDN or custom domain) |
| 184 | if (s3Config.publicUrl) { |
| 185 | return s3Config.publicUrl; |
| 186 | } |
| 187 | |
| 188 | // Use the constructed endpoint + bucket name |
| 189 | const endpoint = this.getEndpoint(); |
| 190 | return `${endpoint}/${s3Config.bucketName}`; |
| 191 | } |
| 192 | } |