➊
const s3 = new S3Client({
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
},
region: 'ap-northeast-2',
});
➋
const upload = multer({
storage: multerS3({
s٣,
bucket: 'nodebird33',
key(req, file, cb) {
cb(null, `original/${Date.now()}_${file.originalname}`);
},
}),
limits: { fileSize: 5 * 1024 * 1024 },
});
...