feathers-tcomb
validate feathers
services using tcomb
install
with npm
, run
npm install --save feathers-tcomb
usage
In order for this module to work, you must configure
hooks on your feathers app.
var feathers = var hooks = var bodyParser = var memory = var validate = var t = var app = var Thing = t
api
validate(service, type, [options])
Given a feathers
service
, a tcomb
type
and optional options
for tcomb-validation
, will add a before
hook to create
, update
, and patch
methods to validate the incoming data based on the type definition.
On an error, returns a feathers-errors
BadRequest
.