Skip to content

Instantly share code, notes, and snippets.

@IvsonEmidio
Created June 29, 2022 02:24
Show Gist options
  • Save IvsonEmidio/9abdd375b21f5b80980872a9a70781e1 to your computer and use it in GitHub Desktop.
Save IvsonEmidio/9abdd375b21f5b80980872a9a70781e1 to your computer and use it in GitHub Desktop.
import { body, ValidationChain } from "express-validator";
export function validatePost(): ValidationChain[] {
return [
body("name", "check the field 'name' and try again.")
.isString()
.isLength({ min: 3, max: 35 }),
body("email", "check the field 'email' and try again").isEmail(),
body(
"password",
"check the field 'password' and try again"
).isStrongPassword(),
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment