I've been working on validating the response body for my endpoint, but I'm running into an issue where I'm not getting a response from that endpoint when using express-validator. I'm confident that I have followed the official documentation:
Below is the code snippet for my endpoint:
import { body, validationResult } from "express-validator";
export const accountRouter = express.Router();
accountRouter.post( "/signIn", body('userName').notEmpty, body('password').notEmpty, async ( req: express.Request, res: express.Response) => {
const errors = validationResult(req);
if (!errors.isEmpty()) return res.sendStatus(400);
...doStuff();
})