Skip to content

Commit

Permalink
Mongoose connection, fix to depreciation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed Nov 27, 2018
1 parent 2fb17ce commit 608e435
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
'use strict';

import Bot from './Bot';
import customConf from './configs/customConf.json';

if (customConf.db === 1) {
try {
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/AxonCoreDB');
Bot.Logger.notice('Connected to AxonCore DataBase.');
mongoose.connect('mongodb://localhost/AxonCoreDB', {
useCreateIndex: true,
autoReconnect: true,
})
.then(() => {
Bot.Logger.notice('Connected to AxonCore DataBase.');
})
.catch(err => {
Bot.Logger.emerg('Could NOT connect to AxonCore DataBase.\n' + err.stack);
});
} catch (e) {
Bot.Logger.emerg('Could NOT connect to AxonCore DataBase.\n' + e.stack);
}
Expand Down

0 comments on commit 608e435

Please sign in to comment.