Renamed config.js to secrets.js to better match the intents of the file

This commit is contained in:
Sahat Yalkabov
2013-12-20 01:31:16 -05:00
parent a6d762b071
commit a9ac61e063
5 changed files with 25 additions and 31 deletions

6
app.js
View File

@@ -14,20 +14,20 @@ var api = require('./controllers/api');
var contact = require('./controllers/contact');
// App Configuration (API Keys, Database URI)
var config = require('./config/config');
var secrets = require('./config/secrets');
var passportConf = require('./config/passport');
// Connect to MongoDB on a separate domain
var dbDomain = domain.create();
dbDomain.run(function() {
mongoose.connect(config.db);
mongoose.connect(secrets.db);
});
// Graceful error handling for MongoDB
dbDomain.on('error', function(err) {
console.error(err.message);
setTimeout(function() {
mongoose.connect(config.db);
mongoose.connect(secrets.db);
}, 1000);
});