0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 10:52:46 +00:00

Adding a new script from populating the DB with a bunch of random brews

This commit is contained in:
Scott Tolksdorf
2017-01-27 09:56:44 -05:00
parent efee8ff05c
commit 2f82d3875e
5 changed files with 66 additions and 7 deletions

View File

@@ -8,14 +8,14 @@ module.exports = {
connect : ()=>{
return new Promise((resolve, reject)=>{
if(mongoose.connection.readyState == 1){
log.info('DB already connected');
log.warn('DB already connected');
return resolve();
}
mongoose.connect(dbPath,
(err) => {
if(err){
log.info('Error : Could not connect to a Mongo Database.');
log.info(' If you are running locally, make sure mongodb.exe is running.');
log.error('Error : Could not connect to a Mongo Database.');
log.error(' If you are running locally, make sure mongodb.exe is running.');
return reject(err);
}
log.info('DB connected.');