mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
Merge branch 'master' of github.com:designcreateplay/NodeBB
This commit is contained in:
@@ -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 MongoDB! Is MongoDB installed? Error :' + 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! Is Redis installed? Error :' + err.message);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
|
||||
if (redis_socket_or_host && redis_socket_or_host.indexOf('/')>=0) {
|
||||
|
||||
Reference in New Issue
Block a user