summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-28 01:43:14 +0300
committereug-vs <eug-vs@keemail.me>2020-11-28 01:43:14 +0300
commit1debf66cde02c86c277286331c837822fac24e3e (patch)
tree5d288e49e9dc1ca13521709b0c656447bc8c0ba2
parent216f5d6603398826e560e8cad386029c60c1470d (diff)
downloadbsu-fantom-1debf66cde02c86c277286331c837822fac24e3e.tar.gz
feat: move logs to another service
-rw-r--r--src/services/events/event.model.js2
-rw-r--r--src/services/index.js2
-rw-r--r--src/services/logs/log.model.js (renamed from src/services/events/log.model.js)0
-rw-r--r--src/services/logs/log.schema.js (renamed from src/services/events/log.schema.js)0
-rw-r--r--src/services/logs/log.service.js9
5 files changed, 12 insertions, 1 deletions
diff --git a/src/services/events/event.model.js b/src/services/events/event.model.js
index 56ba3c9..660cb1a 100644
--- a/src/services/events/event.model.js
+++ b/src/services/events/event.model.js
@@ -1,7 +1,7 @@
const cron = require('cron');
const { model } = require('mongoose');
const schema = require('./event.schema.js');
-const LogModel = require('./log.model.js');
+const LogModel = require('../logs/log.model.js');
const CronJob = cron.CronJob;
diff --git a/src/services/index.js b/src/services/index.js
index b8ef1db..e02a4b8 100644
--- a/src/services/index.js
+++ b/src/services/index.js
@@ -1,10 +1,12 @@
const Users = require('./users/user.service.js');
const Events = require('./events/event.service.js');
+const Logs = require('./logs/log.service.js');
const Auth = require('./auth/auth.service.js');
module.exports = app => {
app.configure(Users);
app.configure(Events);
+ app.configure(Logs);
app.configure(Auth);
app.get('/ping', (req, res) => res.send('pong'));
diff --git a/src/services/events/log.model.js b/src/services/logs/log.model.js
index 64b7da6..64b7da6 100644
--- a/src/services/events/log.model.js
+++ b/src/services/logs/log.model.js
diff --git a/src/services/events/log.schema.js b/src/services/logs/log.schema.js
index bb8d4a5..bb8d4a5 100644
--- a/src/services/events/log.schema.js
+++ b/src/services/logs/log.schema.js
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);
+};
+