Loading lib/document_stores/redis.js +4 −2 Original line number Diff line number Diff line Loading @@ -8,9 +8,11 @@ var winston = require('winston'); // options[db] - The db to use (default 0) // options[expire] - The time to live for each key set (default never) var RedisDocumentStore = function(options) { var RedisDocumentStore = function(options, client) { this.expire = options.expire; if (!RedisDocumentStore.client) { if (client) { RedisDocumentStore.client = client; } else if (!RedisDocumentStore.client) { RedisDocumentStore.connect(options); } }; Loading package.json +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ "dependencies": { "winston": "0.6.2", "connect": "1.9.2", "redis-url": "0.1.0", "uglify-js": "1.3.3" }, "devDependencies": { Loading server.js +11 −2 Original line number Diff line number Diff line Loading @@ -34,8 +34,17 @@ if (!config.storage) { if (!config.storage.type) { config.storage.type = 'file'; } var Store = require('./lib/document_stores/' + config.storage.type); var preferredStore = new Store(config.storage); var Store, preferredStore; if (config.storage.type === 'redistogo') { var redisClient = require('redis-url').connect(process.env.REDISTOGO_URL); Store = require('./lib/document_stores/redis'); preferredStore = new Store(config.storage, redisClient); } else { Store = require('./lib/document_stores/' + config.storage.type); preferredStore = new Store(config.storage); } // Compress the static javascript assets if (config.recompressStaticAssets) { Loading Loading
lib/document_stores/redis.js +4 −2 Original line number Diff line number Diff line Loading @@ -8,9 +8,11 @@ var winston = require('winston'); // options[db] - The db to use (default 0) // options[expire] - The time to live for each key set (default never) var RedisDocumentStore = function(options) { var RedisDocumentStore = function(options, client) { this.expire = options.expire; if (!RedisDocumentStore.client) { if (client) { RedisDocumentStore.client = client; } else if (!RedisDocumentStore.client) { RedisDocumentStore.connect(options); } }; Loading
package.json +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ "dependencies": { "winston": "0.6.2", "connect": "1.9.2", "redis-url": "0.1.0", "uglify-js": "1.3.3" }, "devDependencies": { Loading
server.js +11 −2 Original line number Diff line number Diff line Loading @@ -34,8 +34,17 @@ if (!config.storage) { if (!config.storage.type) { config.storage.type = 'file'; } var Store = require('./lib/document_stores/' + config.storage.type); var preferredStore = new Store(config.storage); var Store, preferredStore; if (config.storage.type === 'redistogo') { var redisClient = require('redis-url').connect(process.env.REDISTOGO_URL); Store = require('./lib/document_stores/redis'); preferredStore = new Store(config.storage, redisClient); } else { Store = require('./lib/document_stores/' + config.storage.type); preferredStore = new Store(config.storage); } // Compress the static javascript assets if (config.recompressStaticAssets) { Loading