API Authentication with Node - Part #4 - Server-Side Validation

in #utopian-io8 years ago (edited)

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.

Video 🎥

Sort:  

The @OriginalWorks bot has determined this post by @codeworkr to be original material and upvoted(1.5%) it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.084
BTC 60995.11
ETH 1571.77
USDT 1.00
SBD 0.47