diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-14 16:31:59 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-14 16:31:59 +0300 |
commit | 36465387454cdb797f886f732d40a70faa92cbad (patch) | |
tree | 28616bd04e3e98c5bd40e82b0c674a0ea9437357 /services | |
parent | 2a791b8999dc08824baf6787021d45df676b4088 (diff) | |
download | bsu-fantom-36465387454cdb797f886f732d40a70faa92cbad.tar.gz |
refactor: reuse Mongoose connection in Agenda
Diffstat (limited to 'services')
-rw-r--r-- | services/events/event.service.js | 8 | ||||
-rw-r--r-- | services/index.js | 10 | ||||
-rw-r--r-- | services/users/user.model.js | 6 | ||||
-rw-r--r-- | services/users/user.schema.js | 14 | ||||
-rw-r--r-- | services/users/user.service.js | 7 |
5 files changed, 0 insertions, 45 deletions
diff --git a/services/events/event.service.js b/services/events/event.service.js deleted file mode 100644 index e96ceda..0000000 --- a/services/events/event.service.js +++ /dev/null @@ -1,8 +0,0 @@ -class Events { - async create(data, params) { - return data; - }; -} - -module.exports = app => app.use('/events', new Events()); - diff --git a/services/index.js b/services/index.js deleted file mode 100644 index f2d65d0..0000000 --- a/services/index.js +++ /dev/null @@ -1,10 +0,0 @@ -const Users = require('./users/user.service.js'); -const Events = require('./events/event.service.js'); - -module.exports = app => { - app.configure(Users); - app.configure(Events); - - app.get('/ping', (req, res) => res.send('pong')); -}; - diff --git a/services/users/user.model.js b/services/users/user.model.js deleted file mode 100644 index 74a83ae..0000000 --- a/services/users/user.model.js +++ /dev/null @@ -1,6 +0,0 @@ -const { model } = require('mongoose'); -const userSchema = require('./user.schema.js'); - -module.exports = model('User', userSchema); - - diff --git a/services/users/user.schema.js b/services/users/user.schema.js deleted file mode 100644 index f2c98ef..0000000 --- a/services/users/user.schema.js +++ /dev/null @@ -1,14 +0,0 @@ -const { Schema } = require('mongoose'); - -module.exports = new Schema({ - username: { - type: String, - unique: true, - required: true - }, - password: { - type: String, - required: true - } -}, { timestamps: true }); - diff --git a/services/users/user.service.js b/services/users/user.service.js deleted file mode 100644 index 67f2ae6..0000000 --- a/services/users/user.service.js +++ /dev/null @@ -1,7 +0,0 @@ -const service = require('feathers-mongoose'); -const Model = require('./user.model.js'); - -const UserService = service({ Model }) - -module.exports = app => app.use('/users', UserService); - |