Skip to content
Browse files

Fixing samples.

  • Loading branch information...
1 parent bda586d commit 350d4b1543b0108cdc046b00fe226e4146e60432 @andrerod andrerod committed
View
2 examples/blobuploader/server.js
@@ -31,7 +31,7 @@ var helpers = require('./helpers.js');
var app = module.exports = express.createServer();
// Global request options, set the retryPolicy
-var blobClient = azure.createBlobService(azure.ServiceClient.DEVSTORE_STORAGE_ACCOUNT, azure.ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, azure.ServiceClient.DEVSTORE_BLOB_HOST).withFilter(new azure.ExponentialRetryPolicyFilter());
+var blobClient = azure.createBlobService('UseDevelopmentStorage=true').withFilter(new azure.ExponentialRetryPolicyFilter());
var containerName = 'webpi';
//Configuration
View
2 examples/blog/blog.js
@@ -33,7 +33,7 @@ var tableName = 'posts';
var partition = 'part1';
Blog = function () {
- this.tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
+ this.tableClient = azure.createTableService('UseDevelopmentStorage=true');
};
Blog.prototype.findAll = function (callback) {
View
4 examples/myevents/server.js
@@ -11,8 +11,8 @@ var express = require('express')
var app = module.exports = express.createServer();
-var tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
-var blobClient = azure.createBlobService(azure.ServiceClient.DEVSTORE_STORAGE_ACCOUNT, azure.ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, azure.ServiceClient.DEVSTORE_BLOB_HOST).withFilter(new azure.ExponentialRetryPolicyFilter());
+var tableClient = azure.createTableService('UseDevelopmentStorage=true');
+var blobClient = azure.createBlobService('UseDevelopmentStorage=true').withFilter(new azure.ExponentialRetryPolicyFilter());
// Create table and blob
tableClient.createTableIfNotExists('events', function(error) {
View
2 examples/tasklist/server.js
@@ -32,7 +32,7 @@ var Home = require('./home');
var ServiceClient = azure.ServiceClient;
var app = module.exports = express.createServer();
-var client = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
+var client = azure.createTableService('UseDevelopmentStorage=true');
// table creation
client.createTableIfNotExists("tasks", function (res, created) {
View
8 lib/services/core/storageserviceclient.js
@@ -73,14 +73,12 @@ util.inherits(StorageServiceClient, ServiceClient);
StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionString, storageAccessKey, host) {
var storageServiceSettings;
- var usePathStyleUri = false;
if (storageAccountOrConnectionString && !storageAccessKey) {
// If storageAccountOrConnectionString was passed and no accessKey was passed, assume connection string
storageServiceSettings = StorageServiceSettings.createFromConnectionString(storageAccountOrConnectionString);
} else {
if (!(storageAccountOrConnectionString && storageAccessKey) && ServiceClient.isEmulated()) {
// Dev storage scenario
- usePathStyleUri = true;
storageServiceSettings = StorageServiceSettings.getDevelopmentStorageAccountSettings();
} else {
// Explicit credentials scenario
@@ -117,8 +115,6 @@ StorageServiceClient.getStorageSettings = function (storageAccountOrConnectionSt
}
}
- storageServiceSettings._usePathStyleUri = usePathStyleUri;
-
return storageServiceSettings;
};
@@ -207,10 +203,14 @@ StorageServiceClient.prototype._getPath = function (path) {
path = '/' + path;
}
+ console.log(path);
+ console.log(this.usePathStyleUri);
if (this.usePathStyleUri) {
path = '/' + this.storageAccount + path;
}
+ console.log(path);
+
return path;
};
View
11 lib/services/core/storageservicesettings.js
@@ -66,13 +66,15 @@ var validKeys = [
* @param {string} blobEndpointUri The storage service blob endpoint.
* @param {string} queueEndpointUri The storage service queue endpoint.
* @param {string} tableEndpointUri The storage service table endpoint.
+* @param {bool} usePathStyleUri Boolean value indicating wether to use path style uri or not.
*/
-function StorageServiceSettings(name, key, blobEndpointUri, queueEndpointUri, tableEndpointUri) {
+function StorageServiceSettings(name, key, blobEndpointUri, queueEndpointUri, tableEndpointUri, usePathStyleUri) {
this._name = name;
this._key = key;
this._blobEndpointUri = blobEndpointUri;
this._queueEndpointUri = queueEndpointUri;
this._tableEndpointUri = tableEndpointUri;
+ this._usePathStyleUri = usePathStyleUri;
}
/**
@@ -96,9 +98,10 @@ StorageServiceSettings._getDevelopmentStorageAccount = function (proxyUri) {
return new StorageServiceSettings(
Constants.DEV_STORE_NAME,
Constants.DEV_STORE_KEY,
- prefix + ':10000/devstoreaccount1/',
- prefix + ':10001/devstoreaccount1/',
- prefix + ':10002/devstoreaccount1/'
+ prefix + ':10000',
+ prefix + ':10001',
+ prefix + ':10002',
+ true
);
};

0 comments on commit 350d4b1

Please sign in to comment.
Something went wrong with that request. Please try again.