I have images stored in an s3 bucket, these are private photos.
Currently I can get a an image url via:
getSignedUrl('getObject', params, callback);
Then I embed the url into an images src=''
string (express, pug). However, I get invalid request errors and no image. How do I go about properly getting the image urls and embedding them into the html?
index.js
app.get('/', (req, res) => {
s3.getSignedUrl('getObject', {
Bucket: Bucket,
Key: Key
}, (err, url) => {
res.render('index', {
img: url
})
})
})
index.pug
html
head
title example
body
img(src="" + img)
I am just learning AWS SDK.
How do I embed an s3 image URL into img src from nodejs?