Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uuid package and added config so sample can work with Mac OSX #12

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"dependencies": {
"aws-config": "^1.1.4",
"aws-sdk": ">= 2.0.9",
"node-uuid": ">= 1.4.1"
"node-uuid": ">= 1.4.1",
"save": "^2.3.2"
}
}
8 changes: 8 additions & 0 deletions sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@
var AWS = require('aws-sdk');
var uuid = require('node-uuid');

// Insert credential info if using Mac OSX
AWS.config.update({
accessKeyId: 'accessKeyId',
secretAccessKey: 'secretAccessKey',
timeout: 15000
});

// Create an S3 client
var s3 = new AWS.S3();

// Create a bucket and upload something into it
var bucketName = 'node-sdk-sample-' + uuid.v4();
var keyName = 'hello_world.txt';


s3.createBucket({Bucket: bucketName}, function() {
var params = {Bucket: bucketName, Key: keyName, Body: 'Hello World!'};
s3.putObject(params, function(err, data) {
Expand Down