We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1e30a5 commit d486053Copy full SHA for d486053
src/modules/s3/component.ts
@@ -36,6 +36,12 @@ export async function createS3Component(components: {
36
const endpoint = await config.getString('AWS_S3_ENDPOINT')
37
const cdnUrl = await config.getString('CDN_URL')
38
39
+ if (cdnUrl) {
40
+ console.log('CDN URL provided', cdnUrl)
41
+ } else {
42
+ console.log('No CDN URL provided')
43
+ }
44
+
45
if (!bucketName) {
46
componentLogger.warn(
47
'Missing AWS bucket - S3 component will use stub implementation'
@@ -89,7 +95,9 @@ export async function createS3Component(components: {
89
95
})
90
96
)
91
97
92
- const fileUrl = endpoint
98
+ const fileUrl = cdnUrl
99
+ ? `${cdnUrl}/${key}`
100
+ : endpoint
93
101
? `${endpoint}/${bucketName}/${key}`
94
102
: `https://${bucketName}.s3.amazonaws.com/${key}`
103
0 commit comments