Created
September 25, 2019 09:49
-
-
Save kusakawazeusu/a9302ce26af57d2d0f53a65b0a792855 to your computer and use it in GitHub Desktop.
request validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/requests/AuthRequest.ts | |
import {check} from "express-validator"; | |
import {showApiError} from "../middleware/AuthMiddleware"; | |
export const loginRequest = [ | |
check('username').exists().isLength({min: 4}), | |
check('password').exists().isLength({min: 4}), | |
showApiError | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment