A simple Node.js library to connect to the Object Storage OVH service
npm install node-ovh-storage --save
var OVHStorage = require('node-ovh-storage');
var config = {
username: 'username',
password: 'password',
authURL: 'https://auth.cloud.ovh.net/v2.0',
tenantId: 'tenantId',
region: 'GRA1'
};
var storage = new OVHStorage(config);
// init token
storage.getToken(function(err) {
// create new container
storage.createContainer('Storage-1', function() {
// put file
storage.putFile('./tmp/doc.pdf', '/Storage-1/doc.pdf', function(err, res) {
// list files in container
storage.getFiles('/Storage-1', function(err, files) {
// done
});
});
});
});