mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-08 08:59:01 +08:00
18 lines
411 B
JavaScript
18 lines
411 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const config = require('config');
|
||
|
const mongodb = require('mongodb');
|
||
|
const MongoClient = mongodb.MongoClient;
|
||
|
|
||
|
module.exports.database = false;
|
||
|
|
||
|
module.exports.connect = callback => {
|
||
|
MongoClient.connect(config.mongo, (err, database) => {
|
||
|
if (err) {
|
||
|
return callback(err);
|
||
|
}
|
||
|
module.exports.database = database;
|
||
|
callback(null, database);
|
||
|
});
|
||
|
};
|