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