Permalink
Browse files

Move DB config into config.js

  • Loading branch information...
1 parent aa2e0b4 commit 30e8c47149a5703833cf7f82eb62a3d7a86d7e1e @cwc cwc committed May 29, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −0 config.js
  2. +3 −2 lib/irchandler.js
View
@@ -0,0 +1,3 @@
+exports.mongodb = {
+ mongoose_auth: 'mongodb://mongodb@localhost/subway'
+}
View
@@ -1,6 +1,7 @@
var irc = require('irc'),
bcrypt = require('bcrypt'),
- mongoose = require('mongoose');
+ mongoose = require('mongoose'),
+ config = require('../config.js');
Schema = mongoose.Schema;
@@ -27,7 +28,7 @@ var User = mongoose.model('User', Users);
var Channel = mongoose.model('Channel', Channels);
var Message = mongoose.model('Message', Messages);
-mongoose.connect('mongodb://localhost/subway');
+mongoose.connect(config.mongodb.mongoose_auth);
var log_message = function(channelName, msg_object) {
Channel.findOne({name: channelName}, function(err, channel) {

0 comments on commit 30e8c47

Please sign in to comment.