var AWS = require('aws-sdk');
var S3FS = require('s3fs');
AWS.config.update({region: 'us-east-1'});
var options = {};
exports.storeMedia = function(req, res){
var fsImpl = new S3FS('test-bucket', options);
fsImpl.writeFile('message.txt', 'Hello Node', function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
}
My code is just a sample code I am trying to test out of the doc samples. I have saved the aws key id and secret in the credentials file under .aws on my macbook. I have already built a user and assigned it access policies such that I am able to get and put objects through the assigned user on AWS Console. What else should I look at? Obviously, I am missing something basic just need a little help over the hump.
Aucun commentaire:
Enregistrer un commentaire