s3 private image getobject react js
app.get("/image/:imageId", function(req, res, next) {
var params = { Bucket: keys.AWS_BUCKET, Key: req.params.imageId };
s3.getObject(params, function(err, data) {
if (err) {
return res.send({ error: err });
}
res.send(data.Body);
});
});