how to validate express js form

Solutions on MaxInterview for how to validate express js form by the best coders in the world

showing results for - "how to validate express js form"
Domenico
22 Mar 2016
1// Validation rules.var loginValidate = [  check('username', 'Username Must Be an Email Address').isEmail(),  check('password').isLength({ min: 8 })  .withMessage('Password Must Be at Least 8 Characters')  .matches('[0-9]').withMessage('Password Must Contain a Number')  .matches('[A-Z]').withMessage('Password Must Contain an Uppercase Letter')];// Process user input.app.post('/login', loginValidate, (req, res) => {  // Insert Login Code Here});