import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
Really? C'mon. It's YOUR examples on YOUR site.Regardless, that's not even what I'm worried about.
The part where you need a key for this service and don't need any of that for S3.
Sorry, but now that means I have to handle credentials with this service, which is something I like to avoid as much as possible.
Let's put it this way.
I can spin up an AWS instance right now and do
await s3lib.set('image.png');
and it works.But if I do:
await f0.set('image.png');
I also need to find a way to properly handle this extra token.And my issue with that is this:
const s3 = new S3Client({
region: region,
credentials: {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey
}
});
You don't need that.But here is the fun part. Here is the AWS code you need to upload a file and have it available.
await s3.send(new PutObjectCommand({Bucket: 'my-bucket',Key: 'image.png',Body: myFile}));
And that's it. Full stop. No key to muck about with.versus
await f0.set('image.png', myFile);
But..., you also need to set the key, so.... SOME_ENV_VAR_FOR_YOUR_SERVICE=howeverlongthisisyouneedtomakesureitgoessomewhere node app.js
And, honestly, we know that's not even the same thing as what I have up there for AWS.Or...
const f0 = new File0({secretKey="howeverlongthisisyouneedtomakesureitgoessomewhere"})
await f0.set('image.png', myFile);
Or... const config = {
secretKey: "howeverlongthisisyouneedtomakesureitgoessomewhere"
};
const f0 = new File0();
await f0.set('image.png', myFile);
await f0.publish('image.png');
Listen, whatever. I'm tired of people being deceptive to try and sell products to programmers. I get it. You are after the lowest common denominator. Someone who actually doesn't know AWS, S3, or anything about Roles. Someone who could set that up in minutes. Fine, I get it. Convenience is real. Just own up to the fact that your examples are purposely bloated on one end and shamelessly thinned on the other end.You literally add extra stuff on the AWS side and remove needed stuff on your side. To me, that's a lie.