-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.js
23 lines (21 loc) · 783 Bytes
/
db.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
|--------------------------------------------------------------------------
| Import the mongoose module.
|--------------------------------------------------------------------------
*/
import mongoose from 'mongoose';
/*
|--------------------------------------------------------------------------
| Get Mongoose to use the global promise library.
|--------------------------------------------------------------------------
*/
mongoose.Promise = global.Promise;
/*
|--------------------------------------------------------------------------
| Export default mongoose connection.
|--------------------------------------------------------------------------
*/
export default function connect() {
const url = process.env.MONGO_URL;
return mongoose.connect(url)
}