diff options
author | Marvin Borner | 2018-10-25 22:22:55 +0200 |
---|---|---|
committer | Marvin Borner | 2018-10-25 22:22:55 +0200 |
commit | 1309e462efc4a7bbdf538e9d209133c1b3c138a6 (patch) | |
tree | 74be20f30280b52e891f7f3507c9d8569fad6b61 /src/services/users/users.service.js | |
parent | 185e0f26c6680c64cb5f2befdedd0cc3bbf09df5 (diff) |
Added authentication and post endpoint
Diffstat (limited to 'src/services/users/users.service.js')
-rw-r--r-- | src/services/users/users.service.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/services/users/users.service.js b/src/services/users/users.service.js new file mode 100644 index 0000000..3cb0535 --- /dev/null +++ b/src/services/users/users.service.js @@ -0,0 +1,22 @@ +// Initializes the `users` service on path `/users` +const createService = require('feathers-sequelize'); +const createModel = require('../../models/users.model'); +const hooks = require('./users.hooks'); + +module.exports = function (app) { + const Model = createModel(app); + const paginate = app.get('paginate'); + + const options = { + Model, + paginate + }; + + // Initialize our service with any options it requires + app.use('/users', createService(options)); + + // Get our initialized service so that we can register hooks + const service = app.service('users'); + + service.hooks(hooks); +}; |