How to manage image URLs with S3 and CloudFront
I am developing a Node.js application that uses S3 and CloudFront to store and distribute images, such as profile pictures. After uploading an image to S3, I save its key (name) in the database. To access these images via CloudFront, I dynamically construct URLs by combining CloudFront’s domain with the S3 key when the API responds.