API Authentication with Node - Part #4 - Server-Side Validation
Description 💻
In the fourth part of API authentication with Node series, we'll focus on server-side validation. We want to make sure that requests that we'll be getting from clients are going to be validated before we use them to do anything - especially interacting with the database!
There are a couple of different ways we could do this. There is a popular module called node-validator and on top of that express-validator module as a wrapper. However, we aren't going to use either of those. Instead, we're going to use the module called Joi. Now, Joi enables us to create a JSON schema that contains our defined rules and validate the requests against that - which is just perfect!
In case you're looking to learn Node, Express, MongoDB, React, client-side validation, server-side validation and more this series should be interesting to you.
@originalworks
The @OriginalWorks bot has determined this post by @codeworkr to be original material and upvoted(1.5%) it!
To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!