Extract cloud credentials
This commit is contained in:
parent
70f5d6dc35
commit
0d09a72242
|
@ -1,10 +1,11 @@
|
|||
var StorageService = require('../').StorageService;
|
||||
var path = require('path');
|
||||
var providers = require('./providers.json');
|
||||
|
||||
var rs = StorageService({
|
||||
provider: 'rackspace',
|
||||
username: 'strongloop',
|
||||
apiKey: 'your-rackspace-api-key'
|
||||
username: providers.rackspace.username,
|
||||
apiKey: providers.rackspace.apiKey
|
||||
});
|
||||
|
||||
// Container
|
||||
|
@ -40,8 +41,8 @@ rs.getContainers(function (err, containers) {
|
|||
|
||||
var s3 = StorageService({
|
||||
provider: 'amazon',
|
||||
key: 'your-amazon-key',
|
||||
keyId: 'your-amazon-key-id'
|
||||
key: providers.amazon.key,
|
||||
keyId: providers.amazon.keyId
|
||||
});
|
||||
|
||||
s3.getContainers(function (err, containers) {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"rackspace": {
|
||||
"username": "strongloop",
|
||||
"apiKey": "your-rackspace-api-key"
|
||||
},
|
||||
"amazon": {
|
||||
"key": "your-amazon-key",
|
||||
"keyId": "your-amazon-key-id"
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
var StorageService = require('../').StorageService;
|
||||
|
||||
var providers = require('./providers.json');
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
|
||||
|
@ -16,8 +16,8 @@ app.configure(function () {
|
|||
var handler = new StorageService(
|
||||
{
|
||||
provider: 'amazon',
|
||||
key: 'your-amazon-key',
|
||||
keyId: 'your-amazon-key-id'
|
||||
key: providers.amazon.key,
|
||||
keyId: providers.amazon.keyId
|
||||
});
|
||||
|
||||
app.get('/', function (req, res, next) {
|
||||
|
|
Loading…
Reference in New Issue