diff options
Diffstat (limited to 'src/services/meal/index.js')
| -rw-r--r-- | src/services/meal/index.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/services/meal/index.js b/src/services/meal/index.js new file mode 100644 index 0000000..88ca1bd --- /dev/null +++ b/src/services/meal/index.js @@ -0,0 +1,29 @@ +'use strict'; + +const service = require('feathers-sequelize'); +const meal = require('./meal-model'); +const hooks = require('./hooks'); + +module.exports = function(){ + const app = this; + + const options = { + Model: meal(app.get('sequelize')), + paginate: { + default: 5, + max: 25 + } + }; + + // Initialize our service with any options it requires + app.use('/meals', service(options)); + + // Get our initialize service to that we can bind hooks + const mealService = app.service('/meals'); + + // Set up our before hooks + mealService.before(hooks.before); + + // Set up our after hooks + mealService.after(hooks.after); +}; |
