WINDOWS KEY, enter "CMD" and open the console with
RETURN. First we create a project directory.
openVALIDATION.validate(req.body)the actual validation process. The
req.bodycontains the corresponding data set to be validated at runtime. Then we check whether
validationRESULTcontains errors. If this is the case, we set the
500and include the corresponding errors in the response. If there were no errors, we simply output "Hello World!
Nameattribute to "Hello", the corresponding error message is displayed in the response as required. If we change the value, the error message no longer appears. Congratulations, you have just implemented your first validation rule!