mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added more error-messages on crashing because of missing files. Closes #227
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
var path = require('path');
|
||||
var mongo_config = require(path.join(path.join(__dirname, '../config/'), 'mongo_config.js'));
|
||||
try {
|
||||
var mongo_config = require(path.join(path.join(__dirname, '../config/'), 'mongo_config.js'));
|
||||
} catch(e) {
|
||||
console.log("Error - missing file");
|
||||
console.log("Seems you forgot to create the file mongo_config.js in /server/config/. Have a look at mongo_config.example.js.");
|
||||
process.exit();
|
||||
}
|
||||
var mongojs = require('mongojs');
|
||||
var db = mongojs(mongo_config.config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user