Use account-level endpoint

This commit is contained in:
Manohar Gupta 2026-05-10 14:43:35 +05:30
parent 7b4f47667b
commit d4f617e159

View file

@ -9,6 +9,9 @@ function getR2() {
const secretKey = "244fcc44041f452241cbc68374cd7a6ca651cb71f361bc36cc932407bbe37863"; const secretKey = "244fcc44041f452241cbc68374cd7a6ca651cb71f361bc36cc932407bbe37863";
const bucket = "tia"; const bucket = "tia";
// Try just account-level endpoint (no bucket in path)
const endpoint = `https://${accountId}.r2.cloudflarestorage.com`;
if (!accountId || !accessKeyId || !secretKey || !bucket) { if (!accountId || !accessKeyId || !secretKey || !bucket) {
throw new Error(`Missing R2 config`); throw new Error(`Missing R2 config`);
} }