1.2.2 • Published 11 years ago
sailor-validator v1.2.2
Validator for Sailor
Ensure and validate things from your request. Extend validator.js interface.
Install
npm install sailor-validatorUsage
validator = require 'sailor-validator'or using sailor dependency
sailor = require 'sailorjs'
validator = sailor.validatorIdeal for validate thing as pre-conditions in your request:
validator
.begin(req, res)
.add 'user', translate.get('User.NotFound'), 'notEmpty'
.end (params) ->In this example, if user param is empty compound a badRequest response that follow sailor-errorify schema for errors.
For validate in the request you need to enable sailor-modulde-validator.
License
MIT © Kiko Beats