framez-server/Server/Utils/DBUtil.js

25 lines
510 B
JavaScript
Raw Normal View History

2018-04-27 12:23:19 +00:00
// Config module
const Config = require('../Config/Config.js')
const mongoose = require('mongoose');
mongoose.connect(Config.mongoURL);
const Schemas = {}
var normalizedPath = require("path").join(__dirname, "..", "Schemas");
// Load All Schemas and put them in Shemas Obj
require("fs").readdirSync(normalizedPath).forEach(function(file) {
Schemas[file.split('.')[0]] = require(normalizedPath + '/' + file);
});
const util = {
getSomething: () => {
},
Schemas: Schemas
}
module.exports = util;