diff --git a/example/src/index.js b/example/src/index.js index c3c047ae..92f744ce 100644 --- a/example/src/index.js +++ b/example/src/index.js @@ -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); }