diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-28 01:43:14 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-28 01:43:14 +0300 |
commit | 1debf66cde02c86c277286331c837822fac24e3e (patch) | |
tree | 5d288e49e9dc1ca13521709b0c656447bc8c0ba2 /src/services/logs | |
parent | 216f5d6603398826e560e8cad386029c60c1470d (diff) | |
download | bsu-fantom-1debf66cde02c86c277286331c837822fac24e3e.tar.gz |
feat: move logs to another service
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); +}; + |