Skip to content

Commit

Permalink
Added MongoDB support
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Eduardo authored and Luiz Eduardo committed Apr 24, 2016
1 parent 1618266 commit cb6ad32
Show file tree
Hide file tree
Showing 4 changed files with 687 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"ws": "^1.0.1",
"xoauth2": "^1.1.0",
"forever": "^0.15.1",
"ps-tree": "^1.0.1"
"ps-tree": "^1.0.1",
"mongodb":"^2.1.16"
}
}
6 changes: 5 additions & 1 deletion serverconfig.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ config.loginExpire = 7;

// Database config
config.db = {
dbType: 'level', // Values "level" for LevelDB and "mysql" for MySQL
dbType: 'level', // Values "level" for LevelDB, "mysql" for MySQL and "mongo" for MongoDB
dbDir: './socketserver/db', // Only used for LevelDB. Directory to save databases. Default is ./socketserver/db
mysqlUser: '', // Only used for MySQL. Database username
mysqlPassword: '', // Only used for MySQL. Database password
mysqlHost: '', // Only used for MySQL. Host address
mysqlDatabase: '', // Only used for MySQL. Database being used
mongoUser: '', // Only used for MongoDB. Database username
mongoPassword: '', // Only used for MongoDB. Database password
mongoHost: '', // Only used for MongoDB. Host address
mongoDatabase: '' // Only used for MongoDB. Database being used
};

/*
Expand Down
2 changes: 2 additions & 0 deletions socketserver/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function Database(){
return require('./db_level');
case 'mysql':
return require('./db_mysql');
case 'mongo':
return require('./db_mongo');
}
}

Expand Down
Loading

0 comments on commit cb6ad32

Please sign in to comment.