Skip to content

Commit

Permalink
feat: added cors (#122)
Browse files Browse the repository at this point in the history
Added CORS
  • Loading branch information
cazala authored Dec 19, 2024
1 parent 2453597 commit cba46de
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules/s3/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export async function createS3Component(components: {
Body: JSON.stringify({ ok: true, data: tiles }),
ContentType: 'application/json',
CacheControl: 'public, max-age=60',
ACL: 'public-read',
Metadata: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
},
})
)

Expand All @@ -111,6 +117,12 @@ export async function createS3Component(components: {
Body: JSON.stringify({ timestamp }),
ContentType: 'application/json',
CacheControl: 'public, max-age=60',
ACL: 'public-read',
Metadata: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
},
})
)
componentLogger.info(`Uploaded timestamp to S3`)
Expand Down

0 comments on commit cba46de

Please sign in to comment.