mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Changes
This commit is contained in:
30
config/db.js
Normal file
30
config/db.js
Normal 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();
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user