FluffyUpload/middleware/Storage.js

12 lines
315 B
JavaScript
Raw Normal View History

2024-07-10 18:57:38 +02:00
const AWS = require('aws-sdk');
require('dotenv').config();
const r2Endpoint = new AWS.Endpoint(process.env.R2_ENDPOINT);
const s3 = new AWS.S3({
endpoint: r2Endpoint,
accessKeyId: process.env.R2_ACCESS_KEY,
secretAccessKey: process.env.R2_SEC_KEY,
s3ForcePathStyle: true,
});
module.exports = s3;