Created
May 29, 2012 18:02
-
-
Save ovaillancourt/2829777 to your computer and use it in GitHub Desktop.
mongoose startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Includes | |
var uriAssembler = require('./common/util/uriAssembler.js'); | |
//Initialize configuration data | |
var cfg = exports.cfg = require('./common/util/configuration.js') | |
.ensureLoad('/common/config/'); | |
// [...] | |
//Initialize mongoose | |
var mongoose = require('mongoose'); | |
mongoose.connect(uriAssembler( | |
'mongodb', | |
cfg.get().database_host, | |
cfg.get().database_port, | |
cfg.get().database_name, | |
cfg.get().database_login, | |
cfg.get().database_password), | |
{'auto_reconnect' : true, poolsize: cfg.get().database_poolSize } | |
); | |
//Initialize mongoose models | |
var Models = require('./common/models'); //this file declares every schema | |
// [...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment