Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
Use global.Promise as mongoose promise library
Browse files Browse the repository at this point in the history
  • Loading branch information
qasim committed Jul 9, 2016
1 parent 309a553 commit a5e7bf3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let test = process.argv.join().match('/ava/')
let enableSync = process.env.COBALT_ENABLE_DB_SYNC || 'true'

// Database connection setup
mongoose.Promise = global.Promise
mongoose.connect(process.env.COBALT_MONGO_URI, err => {
if (err) throw new Error(`Failed to connect to MongoDB [${process.env.COBALT_MONGO_URI}]: ${err.message}`)
if (!test) {
Expand Down

0 comments on commit a5e7bf3

Please sign in to comment.