Wednesday, 4 July 2018

What is your incoming data validation strategy for Node.js based API?

I'm trying to find out what's should be the best validation strategy I have to apply to our API Node.js servers. Currently I'm doing next things:- Initial request params validation with validator.js (express-validator);- Sanitize params and remove all unexpected params;- Validation on the model level with Knex/Sequelize. Some validations are similar with what we have at initial request params validation, but we still need to have it for the reason that some models used in non API microservices;- Validation on the database level, some constraints and requirements applied directly to the database for the reason of keeping database data in consistent.So I'm wondering how people dealing with it, what's libraries use?

Submitted July 04, 2018 at 01:01PM by AlexBV1

No comments:

Post a Comment