summaryrefslogtreecommitdiff
path: root/src/services/user/index.js
blob: 3f3438f1016b4f1d2f4e25945fb8d94e675f5b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';

const service = require('feathers-sequelize');
const user = require('./user-model');
const hooks = require('./hooks');

module.exports = function(){
  const app = this;

  const options = {
    Model: user(app.get('sequelize')),
    paginate: {
      default: 5,
      max: 25
    }
  };

  // Initialize our service with any options it requires
  app.use('/users', service(options));

  // Get our initialize service to that we can bind hooks
  const userService = app.service('/users');

  // Set up our before hooks
  userService.before(hooks.before);

  // Set up our after hooks
  userService.after(hooks.after);
};