I am currently working on a MEAN stack using node, express and angularjs. I downloaded the boiler plate code from mean.io and also used a debugger while I study the code.
In a controller that receives req and res as parameters, how does req.assert work?
In the file server / controllers / users.js
req.assert('username', 'Username cannot be more than 20 characters').len(1,20);
adds a validation error even when the username is empty or empty. How to check current username value in req? Where is the assert req function defined.
I come from a java background and find it difficult to find the function code several times, since I will not be sure where it is defined and how it is prototyped. How to read objects and view functions used in javascript correctly?
source share