// plugins.ts
export default ({ env }) => ({
  upload: {
    config: {
      provider: '@strapi/provider-upload-aws-s3',
      providerOptions: {
        accessKeyId: env('AWS_ACCESS_KEY_ID'),
        secretAccessKey: env('AWS_ACCESS_SECRET'),
        region: env('AWS_REGION'),
        params: {
          Bucket: env('AWS_BUCKET'),
          ACL: env('AWS_ACL', 'public-read'),
          signedUrlExpires: env.int('AWS_SIGNED_URL_EXPIRES', 900),
        },
        baseUrl: env('CLOUDFRONT_URL', 'https://blog-media.genomii.ai'), // Add this line
        rootPath: 'uploads',  // Optional - for organizing files
      },
    },
  },
});