Exports the createClient
This commit is contained in:
parent
cda8ff2e17
commit
564d8c3432
|
@ -1,7 +1,7 @@
|
||||||
var storage = require('../lib/factory');
|
var storage = require('../');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
var rs = storage.createClient({
|
var rs = storage({
|
||||||
provider: 'rackspace',
|
provider: 'rackspace',
|
||||||
username: 'strongloop',
|
username: 'strongloop',
|
||||||
apiKey: 'your-rackspace-api-key'
|
apiKey: 'your-rackspace-api-key'
|
||||||
|
@ -39,7 +39,7 @@ rs.getContainers(function (err, containers) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var s3 = storage.createClient({
|
var s3 = storage({
|
||||||
provider: 'amazon',
|
provider: 'amazon',
|
||||||
key: 'your-amazon-key',
|
key: 'your-amazon-key',
|
||||||
keyId: 'your-amazon-key-id'
|
keyId: 'your-amazon-key-id'
|
||||||
|
@ -60,7 +60,7 @@ s3.getContainers(function (err, containers) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var fs = storage.createClient({
|
var fs = storage({
|
||||||
provider: 'filesystem',
|
provider: 'filesystem',
|
||||||
root: path.join(__dirname, 'storage')
|
root: path.join(__dirname, 'storage')
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
exports.createClient = function (options) {
|
function createClient(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var provider = options.provider || 'filesystem';
|
var provider = options.provider || 'filesystem';
|
||||||
|
|
||||||
|
@ -15,3 +15,6 @@ exports.createClient = function (options) {
|
||||||
return new provider(options);
|
return new provider(options);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = createClient;
|
||||||
|
module.exports.createClient = createClient;
|
|
@ -51,7 +51,7 @@ Uploader.prototype.processUpload = function (req, res, cb) {
|
||||||
} else {
|
} else {
|
||||||
values.push(value);
|
values.push(value);
|
||||||
}
|
}
|
||||||
self.emit('field', part.name + '[' + (values.length -1) + ']', value);
|
self.emit('field', part.name, value);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ Uploader.prototype.processUpload = function (req, res, cb) {
|
||||||
} else {
|
} else {
|
||||||
values.push(file);
|
values.push(file);
|
||||||
}
|
}
|
||||||
self.emit('file', part.name + '[' + (values.length -1) + ']', file);
|
self.emit('file', part.name, file);
|
||||||
self._maybeEnd();
|
self._maybeEnd();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "asteroid-storage-service",
|
"name": "asteroid-storage-service",
|
||||||
"description": "Asteroid Storage Service",
|
"description": "Asteroid Storage Service",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "lib/index.js",
|
"main": "lib/factory.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "./node_modules/.bin/mocha --timeout 30000 test/*test.js"
|
"test": "./node_modules/.bin/mocha --timeout 30000 test/*test.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue