1const AWS = require('aws-sdk');
2AWS.config.update(
3 {
4 accessKeyId: "....",
5 secretAccessKey: "...",
6 region: 'ap-southeast-1'
7 }
8);
9const s3 = new AWS.S3();
10const options = {
11 Bucket : '/bucket-url',
12 Key : fileKey,
13};
14const fileStream = s3.getObject(options).createReadStream();
15fileStream.pipe(res);