diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-07-27 21:15:07 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-07-27 21:16:19 +0200 |
commit | 32bb41560279dd0c75d0461f081873483e3aaed9 (patch) | |
tree | ef4d621d7f9f5ffcadf437da0e872042312305bc /server/initializers | |
parent | f24c4e44624058e16d4a09856fac8c409203c59f (diff) | |
download | PeerTube-32bb41560279dd0c75d0461f081873483e3aaed9.tar.gz PeerTube-32bb41560279dd0c75d0461f081873483e3aaed9.tar.zst PeerTube-32bb41560279dd0c75d0461f081873483e3aaed9.zip |
Server: Use ES6 promise for mongoose/node-oatuh2-server
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/database.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/server/initializers/database.js b/server/initializers/database.js index 4a19bc230..8626895ee 100644 --- a/server/initializers/database.js +++ b/server/initializers/database.js | |||
@@ -23,6 +23,7 @@ const database = { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | function connect () { | 25 | function connect () { |
26 | mongoose.Promise = global.Promise | ||
26 | mongoose.connect('mongodb://' + host + ':' + port + '/' + dbname) | 27 | mongoose.connect('mongodb://' + host + ':' + port + '/' + dbname) |
27 | mongoose.connection.on('error', function () { | 28 | mongoose.connection.on('error', function () { |
28 | throw new Error('Mongodb connection error.') | 29 | throw new Error('Mongodb connection error.') |