Skip to content
#

expressjs

express logo

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

Here are 27,102 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

express-gateway
XVincentX
XVincentX commented Jan 2, 2018

If not for some particular exceptions, the status code returned from our WebAPI on error is always 500, regardless of the kind of error.

If an object already exists, for example, it should be returned as 409. If the object does not pass the schema validation, it should be a 415.

Go through the whole WebAPI and verify that the status codes are being returned correctly.

Hint: Error cl

Created by TJ Holowaychuk

Released November 16, 2010

Organization
expressjs
Website
expressjs.com
Wikipedia
Wikipedia