You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
592 B
JavaScript

5 years ago
//const config = require('./config')
5 years ago
const mongoose = require('mongoose')
const mongoOptions = {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: true,
5 years ago
dbName: process.env.MONGO_DBNAME || 'mcaccountschecker',
5 years ago
}
5 years ago
mongoose.connect(process.env.MONGO_DBURI || 'mongodb://admin:admin@mongo:27017', mongoOptions, (err) => {
5 years ago
if (!!err) process.exit(1)
console.log('CONNECTED TO MONGODB')
})
.catch(() => process.exit(2))
/*.then(() => {
GridFS.CONNECTION = mongoose.connection
})*/
const Models = require('./models')
module.exports = { mongoose, Models }