This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This binds the node-validator library to the req object so that | |
* the validation / sanitization methods can be called on parameter | |
* names rather than the actual strings. | |
* | |
* 1. Be sure to include `req.mixinParams()` as middleware to merge | |
* query string, body and named parameters into `req.params` | |
* | |
* 2. To validate parameters, use `req.check(param_name, [err_message])` | |
* e.g. req.check('param1').len(1, 6).isInt(); |
NewerOlder