fix: Ajouter valeur par défaut pour AWS_S3_BUCKET_NAME dans route download

This commit is contained in:
odentas 2025-12-10 15:56:39 +01:00
parent 1954d90255
commit 39fea18d9e

View file

@ -36,12 +36,13 @@ export async function GET(request: NextRequest) {
}
// Télécharger le fichier depuis S3
const bucketName = process.env.AWS_S3_BUCKET_NAME || "odentas-docs"
const command = new GetObjectCommand({
Bucket: process.env.AWS_S3_BUCKET_NAME || '',
Bucket: bucketName,
Key: path,
})
console.log('📥 Download API - Fetching from S3, bucket:', process.env.AWS_S3_BUCKET_NAME, 'key:', path)
console.log('📥 Download API - Fetching from S3, bucket:', bucketName, 'key:', path)
const response = await s3Client.send(command)