Baris Usakli 11 years ago
parent 27ac24b1e3
commit 0000a7f0b9

@ -14,14 +14,10 @@
},
"dependencies": {
"socket.io": "~0.9.16",
"redis": "0.8.3",
"mongodb": "~1.3.19",
"express": "3.2.0",
"express-namespace": "~0.1.1",
"emailjs": "0.3.4",
"cookie": "0.0.6",
"connect-redis": "1.4.5",
"connect-mongo": "0.4.0",
"passport": "0.1.17",
"passport-local": "0.1.6",
"passport-twitter": "0.1.5",
@ -50,6 +46,10 @@
"semver": "~2.2.1"
},
"optionalDependencies": {
"redis": "0.8.3",
"mongodb": "~1.3.19",
"connect-redis": "1.4.5",
"connect-mongo": "0.4.0",
"hiredis": "~0.1.15"
},
"devDependencies": {

@ -2,17 +2,25 @@
(function(module) {
'use strict';
var mongoClient = require('mongodb').MongoClient,
winston = require('winston'),
var winston = require('winston'),
async = require('async'),
nconf = require('nconf'),
express = require('express'),
mongoStore = require('connect-mongo')(express),
mongoHost = nconf.get('mongo:host'),
db;
db,
mongoClient,
mongoStore;
try {
mongoClient = require('mongodb').MongoClient;
mongoStore = require('connect-mongo')(express);
} catch (err) {
winston.error('Unable to initialize mongo! ' + err.message);
process.exit();
}
module.init = function(callback) {
mongoClient.connect('mongodb://'+ mongoHost + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'), function(err, _db) {
mongoClient.connect('mongodb://'+ nconf.get('mongo:host') + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'), function(err, _db) {
if(err) {
winston.error("NodeBB could not connect to your Mongo database. Mongo returned the following error: " + err.message);
process.exit();

@ -2,16 +2,24 @@
(function(module) {
'use strict';
var redisClient,
redis = require('redis'),
winston = require('winston'),
var winston = require('winston'),
nconf = require('nconf'),
express = require('express'),
connectRedis = require('connect-redis')(express),
reds = require('reds'),
redis_socket_or_host = nconf.get('redis:host'),
utils = require('./../../public/src/utils.js');
utils = require('./../../public/src/utils.js'),
redis,
connectRedis,
reds,
redisClient;
try {
redis = require('redis');
connectRedis = require('connect-redis')(express);
reds = require('reds');
} catch (err) {
winston.error('Unable to initialize redis! ' + err.message);
process.exit();
}
if (redis_socket_or_host && redis_socket_or_host.indexOf('/')>=0) {

Loading…
Cancel
Save