This commit is contained in:
Dobie Wollert
2015-12-16 09:12:35 -08:00
parent f9c9672818
commit f94ca33b9e
805 changed files with 67409 additions and 24609 deletions

30
config/db.js Normal file
View File

@ -0,0 +1,30 @@
'use strict';
const mongoose = require('mongoose');
const models = [
'CheckList',
'Client',
'Counter',
'Device',
'DeviceType',
'Pm',
'Post',
'Tag',
'TestRun',
'TimeClockException',
'TimeClockSpan',
'User',
'Workorder'
];
module.exports = function() {
return function(req, res, next) {
req.db = {};
models.forEach((model) => {
req.db[model] = mongoose.model(model);
});
next();
}
};