Skip to content
#

Express

express logo

Express.js is a simple Node.js framework for single, multi-page, and hybrid web applications.

Here are 38,631 public repositories matching this topic...

express-validator
NeverwinterMoon
NeverwinterMoon commented Oct 12, 2021

I managed to find a way to fail-fast the validation chain with bail, but what about failing fast the middleware list?

Say, I have

.post(
  '/somewhere',
  body('name').exists(),
  body('phoneNumber').exists(),
  handleStuff
)

If the name validation fails, I don't care to check phoneNumber anymore... Wasn't able to find a way to fail fast in this case. In the case

Created by TJ Holowaychuk

Released November 16, 2010

Organization
expressjs
Website
expressjs.com
Wikipedia
Wikipedia