This commit is contained in:
oitsjustjose 2022-04-16 17:41:12 -05:00
commit 88a7e70ead
11 changed files with 135 additions and 112 deletions

View file

@ -0,0 +1,20 @@
import aws from "aws-sdk";
let cached: aws.S3 | null = null;
export default () => {
if (cached) {
return cached;
}
const S3 = new aws.S3({
region: process.env.AWS_REGION,
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
apiVersion: "2006-03-01",
signatureVersion: "v4",
});
cached = S3;
return cached;
};