Files
biomedjs/config/db.js

32 lines
453 B
JavaScript
Raw Permalink Normal View History

2015-12-16 09:12:35 -08:00
'use strict';
const mongoose = require('mongoose');
const models = [
'CheckList',
'Client',
'Counter',
'Device',
'DeviceType',
'Pm',
'Post',
'Tag',
'TestRun',
'TimeClockException',
'TimeClockSpan',
2015-12-20 23:44:49 -08:00
'TimeSheet',
2015-12-16 09:12:35 -08:00
'User',
'Workorder'
];
module.exports = function() {
return function(req, res, next) {
req.db = {};
models.forEach((model) => {
req.db[model] = mongoose.model(model);
});
next();
}
};