Use bucket path format

This commit is contained in:
Manohar Gupta 2026-05-10 14:26:08 +05:30
parent 2bf37de50b
commit 5de4294919

View file

@ -21,11 +21,11 @@ function getR2() {
return {
client: new S3Client({
region: "auto",
endpoint,
endpoint: `https://${accountId}.r2.cloudflarestorage.com`,
credentials: { accessKeyId, secretAccessKey: secretKey },
}),
bucket,
baseUrl: endpoint,
baseUrl: `https://${accountId}.r2.cloudflarestorage.com/${bucket}`,
};
}