1.2.0 • Published 7 years ago

feathers-joi v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

feathers-joi

FeathersJS Service Hook Data Validation with Joi

Installation

npm i --save feathers-joi

Usage

const joi = require('joi')
const validate = require('feathers-joi')
const schema = joi.string().required()

// optional
const options = {
  stripUnknown: true
}

// feathers app, configured with feathers-hooks
module.exports = app => {
  app.service('/route').hooks({
    before: {
      create: validate({ schema })
    },
    after: {
      create: validate({ schema, options })
    }
  })
}

default options = { hookType: 'before', stripUnknown: false }

1.2.0

7 years ago

1.1.3

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago