Upload latest code and optimized prompts (v6)
This commit is contained in:
20
check_buckets.js
Normal file
20
check_buckets.js
Normal file
@@ -0,0 +1,20 @@
|
||||
require('dotenv').config();
|
||||
const { S3Client, ListBucketsCommand } = require('@aws-sdk/client-s3');
|
||||
|
||||
const client = new S3Client({
|
||||
region: 'auto',
|
||||
endpoint: `https://${process.env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com`,
|
||||
credentials: {
|
||||
accessKeyId: process.env.R2_ACCESS_KEY_ID,
|
||||
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
|
||||
},
|
||||
});
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const data = await client.send(new ListBucketsCommand({}));
|
||||
console.log('Buckets:', data.Buckets);
|
||||
} catch (err) {
|
||||
console.error('Error:', err);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user