25 lines
519 B
JavaScript
Executable File
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; |