mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-07 00:17:37 +08:00
17 lines
411 B
JavaScript
17 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);
|
|
});
|
|
};
|