express icon indicating copy to clipboard operation
express copied to clipboard

Create types for error handler with 4 params

Open nicoabie opened this issue 4 years ago • 1 comments

https://expressjs.com/en/guide/error-handling.html

nicoabie avatar Jul 30 '21 01:07 nicoabie

And also for promise support

Starting with Express 5, route handlers and middleware that return a Promise will call next(value) automatically when they reject or throw an error. For example:

app.get('/user/:id', async (req, res, next) => {
  const user = await getUserById(req.params.id)
  res.send(user)
})

darylteo avatar Nov 19 '24 05:11 darylteo