File tree Expand file tree Collapse file tree 6 files changed +7
-3
lines changed Expand file tree Collapse file tree 6 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2929 "babel-runtime" : " ^6.18.0" ,<% if(filters.pug) { %>
3030 "pug" : " ^2.0.0" ,<% } %><% if(filters.html) { %>
3131 "ejs" : " ^2.5.3" ,<% } %><% if(filters.mongoose) { %>
32- "mongoose" : " ^4.13.14 " ,
32+ "mongoose" : " ^5.1.5 " ,
3333 "bluebird" : " ^3.3.3" ,
3434 "connect-mongo" : " ^2.0.1" ,<% } %><% if(filters.sequelize) { %>
3535 "sequelize" : " ^3.23.6" ,
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ var config = {
9090
9191 // Setup mongo for tests
9292 var mongoose = require('mongoose');
93- mongoose.connect(serverConfig.mongo.uri, serverConfig.mongo.options); // Connect to database< % } % >
93+ return mongoose.connect(serverConfig.mongo.uri, serverConfig.mongo.options); // Connect to database< % } % >
9494 }
9595} ;
9696
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import seedDatabaseIfNeeded from './config/seed';<% } %>
1616
1717< % if ( filters . mongoose ) { % >
1818// Connect to MongoDB
19- mongoose.connect(config.mongo.uri, config.mongo.options);
19+ const mongooseConnectionPromise = mongoose.connect(config.mongo.uri, config.mongo.options);
2020mongoose.connection.on('error', function(err) {
2121 console . error ( 'MongoDB connection error: ' + err ) ;
2222 process . exit ( - 1 ) ; // eslint-disable-line no-process-exit
@@ -53,6 +53,7 @@ wsInitPromise
5353 . then ( primus => {
5454 app . primus = primus ;
5555 } ) < % if ( filters . models ) { % >
56+ . then ( ( ) => mongooseConnectionPromise )
5657 . then ( seedDatabaseIfNeeded ) < % } %>
5758 . then ( startServer )
5859 . catch ( err => {
Original file line number Diff line number Diff line change 66module . exports = { < % if ( filters . mongoose ) { % >
77 // MongoDB connection options
88 mongo : {
9+ useMongoClient : true ,
910 uri : process . env . MONGODB_URI || 'mongodb://localhost/<%= lodash.slugify(appname) %>-dev'
1011 } , < % } if ( filters . sequelize ) { % >
1112
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module.exports = {
1616
1717 // MongoDB connection options
1818 mongo : {
19+ useMongoClient : true ,
1920 uri : process . env . MONGODB_URI
2021 || process . env . MONGOHQ_URL
2122 || process . env . OPENSHIFT_MONGODB_DB_URL + process . env . OPENSHIFT_APP_NAME
Original file line number Diff line number Diff line change 66module . exports = {
77 // MongoDB connection options
88 mongo : {
9+ useMongoClient : true ,
910 uri : 'mongodb://localhost/<%= lodash.slugify(appname) %>-test'
1011 } ,
1112 sequelize : {
You can’t perform that action at this time.
0 commit comments