25 lines
510 B
JavaScript
25 lines
510 B
JavaScript
|
// 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;
|