Answer the question
In order to leave comments, you need to log in
What kind of array is passed to Express'a post request?
What does this array do in a post request from a router?
router.post(
"/register",
[
check("email", "Некорректный email").isEmail(),
check("password", "Минимальная длина пароля 6 символов").isLength({ min: 6 })
],
() => { ... }
Answer the question
In order to leave comments, you need to log in
After the first argument comes a sequence of middlewares (any number of them). You first have an array of middlewares, and then a regular middleware function.
This is described in the doc:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question