dyno-bot/Dyno-streams-master/lib/models.js
2020-09-12 19:08:48 +01:00

25 lines
519 B
JavaScript
Executable File

'use strict';
//const getenv = require('getenv');
const DataFactory = require('Dyno-DataFactory');
//require('dotenv').config({ silent: true });
const dbString = require('../config.json').mongo.url;
if (!dbString) {
throw new Error('Missing environment variable CLIENT_MONGO_URL.');
}
const db = new DataFactory({
dbString,
logger: {
level: 'info',
},
});
const models = db.models;
models.mongoose = db.mongoose;
models.Schema = db.Schema;
module.exports = models;