const R2_URL = `https://${ctx.env.ACCOUNT_ID}.r2.cloudflarestorage.com`
const s3Client = new S3Client({
region: "auto",
endpoint: R2_URL,
credentials: {
accessKeyId: ctx.env.ACCESS_KEY_ID,
secretAccessKey: ctx.env.ACCESS_KEY,
},
})
const objectKey = `${app.slug}/${input.name}`
const cmd = new PutObjectCommand({
Bucket: ctx.env.BUCKET_NAME,
Key: objectKey,
})
const signedUrl = await getSignedUrl(s3Client, cmd, { expiresIn: 3600 })
const R2_URL = `https://${ctx.env.ACCOUNT_ID}.r2.cloudflarestorage.com`
const s3Client = new S3Client({
region: "auto",
endpoint: R2_URL,
credentials: {
accessKeyId: ctx.env.ACCESS_KEY_ID,
secretAccessKey: ctx.env.ACCESS_KEY,
},
})
const objectKey = `${app.slug}/${input.name}`
const cmd = new PutObjectCommand({
Bucket: ctx.env.BUCKET_NAME,
Key: objectKey,
})
const signedUrl = await getSignedUrl(s3Client, cmd, { expiresIn: 3600 })