Saturday, 7 September 2013

Amazon AWS listObjects call error

Amazon AWS listObjects call error

Im trying to call a method listObjects on my Amazon S3 Bucket using the
Node.js SDK. However I am getting an error on the keyword require. The API
I am using is this:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3_20060301.html#listObjects-property
var AWS = require('aws-sdk');
AWS.config.loadFromPath('credentials.json');
AWS.config.update({region: 'us-west-2'});
listObjects(params = {Bucket:'wepicit.s3.amazonaws.com'},
function(data,err){
console.log(data);
console.log('Error'+err);
});
Thank You!!

No comments:

Post a Comment