Get standalone server mode working for all tests.
This commit is contained in:
parent
cb28eeefbb
commit
81836b6981
78 changed files with 957 additions and 783 deletions
26
other_langs/test.js
Normal file
26
other_langs/test.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
var AWS = require('aws-sdk');
|
||||
|
||||
var s3 = new AWS.S3({endpoint: "http://localhost:8086"});
|
||||
var myBucket = 'my.unique.bucket.name';
|
||||
|
||||
var myKey = 'myBucketKey';
|
||||
|
||||
s3.createBucket({Bucket: myBucket}, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
params = {Bucket: myBucket, Key: myKey, Body: 'Hello!'};
|
||||
s3.putObject(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
} else {
|
||||
console.log("Successfully uploaded data to myBucket/myKey");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
s3.listBuckets(function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue