diff options
Diffstat (limited to 'src/services/logs')
-rw-r--r-- | src/services/logs/log.model.js | 7 | ||||
-rw-r--r-- | src/services/logs/log.schema.js | 7 | ||||
-rw-r--r-- | src/services/logs/log.service.js | 9 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/services/logs/log.model.js b/src/services/logs/log.model.js new file mode 100644 index 0000000..64b7da6 --- /dev/null +++ b/src/services/logs/log.model.js @@ -0,0 +1,7 @@ +const { model } = require('mongoose'); +const schema = require('./log.schema.js'); + +const Model = model('Log', schema); + + +module.exports = Model; diff --git a/src/services/logs/log.schema.js b/src/services/logs/log.schema.js new file mode 100644 index 0000000..bb8d4a5 --- /dev/null +++ b/src/services/logs/log.schema.js @@ -0,0 +1,7 @@ +const { Schema, Types } = require('mongoose'); + +module.exports = new Schema({ + eventId: Types.ObjectId, + message: String +}, { timestamps: true }); + diff --git a/src/services/logs/log.service.js b/src/services/logs/log.service.js new file mode 100644 index 0000000..899ec86 --- /dev/null +++ b/src/services/logs/log.service.js @@ -0,0 +1,9 @@ +const service = require('feathers-mongoose'); +const Model = require('./log.model.js'); + +const LogService = service({ Model }); + +module.exports = app => { + app.use('/logs', LogService); +}; + |