express-validation-joi
v1.0.1
Published
A versatile middleware for Express applications, designed to seamlessly integrate with Joi for powerful request data validation.
Downloads
18
Readme
express-validation-joi
express-validation-joi is a middleware package designed for Express applications, aimed at simplifying request data validation using Joi. This package provides seamless integration with Express, allowing you to easily validate incoming request bodies, query parameters, and route parameters using Joi schemas.
- Token logic
- Api Response handler
- Middlewares and Guards
Usage
- Install then import the package
// Install npm install express-validation-joi // Or yarn add express-validation-joi // Import import { ServerResponse, TokenHelper, JaHttpStatusCode } from 'npm install express-validation-joi' - Then use them like
return new ServerResponse(
JaHttpStatusCode.BAD_REQUEST, // the response status
"A message",
true, // If the request succeed
{}, // The data to send to the client
errors.array() // if any error
).sendResponse(res);