DEV Community

Discussion on: A Clean Approach to Using Express Validator

Collapse
 
nedsoft profile image
Chinedu Orie

Hi Mohammad, If I got your question clearly it means you're using server side rendering. The example above would serve well for an API where all responses are JSON objects. In your case, you return a view instead of a JSON object. So what you should do is to return a view then passing the error object as a data to the view.