-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
24 lines (23 loc) · 1.15 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const mongoose = require('mongoose');
const autoIncrement = require('mongoose-auto-increment');
module.exports = {
connect: (database) => {
return new Promise((resolve, reject) => {
mongoose.createConnection(database, { useNewUrlParser: true, useUnifiedTopology: true })
.then((connection) => {
autoIncrement.initialize(connection);
module.exports.queueDB = connection;
resolve({
register: require('./functions/register'),
beginQueue: require('./functions/beginQueue'),
endQueue: require('./functions/endQueue'),
reportMatch: require('./functions/reportMatch'),
confirmMatch: require('./functions/confirmMatch'),
getPlayerCurrentMatch: require('./functions/util/getPlayerCurrentMatch')
// displayStats: require('./functions/displayStats'),
// displayLeaderboard: require('./functions/displayLeaderboard'),
});
}).catch(reject);
});
}
}