express validator check object

Solutions on MaxInterview for express validator check object by the best coders in the world

showing results for - "express validator check object"
Lorenzo
18 Jun 2017
1const express = require('express');
2const { check } = require('express-validator');
3
4const app = express();
5app.use(express.json());
6
7app.post(
8  '/addresses',
9  check('addresses.*.postalCode').isPostalCode(),
10  check('addresses.*.number').toInt(),
11  (req, res) => {
12    // Handle the request
13  },
14);