Files
BotsCord/index.js
T

17 lines
453 B
JavaScript
Raw Normal View History

2022-07-30 16:09:49 +02:00
// Load Bot and website
const bot = require('./bot');
const website = require('./website');
// Import config and export
const config = require('./config');
2022-07-30 16:19:58 +02:00
const mongoose = require('mongoose');
2022-07-30 16:09:49 +02:00
// Connect to mongoDB
try {
2022-07-30 16:19:58 +02:00
mongoose.connect(config.mongodb);
2022-07-30 16:09:49 +02:00
} catch (err) {
2022-07-30 16:19:58 +02:00
console.log(err);
2022-07-30 16:09:49 +02:00
console.log('Error connecting to mongoDB');
process.exit(1);
}
//export config
module.exports.config = config;
module.exports.mongoose = mongoose;