HackYourFuture-CPH / FP-class11

Class11 Final Project - A collaboration between HYF and Seasony
MIT License
5 stars 8 forks source link

Fix: Add 'next' to error-handling middleware #162

Closed kfazinic closed 4 years ago

kfazinic commented 4 years ago

Fixes TypeError: res.sendStatus is not a function when accessing non-existing routes.

Define error-handling middleware functions in the same way as other middleware functions, except with four arguments instead of three, specifically with the signature (err, req, res, next)):

https://expressjs.com/en/api.html ("Error-handling middleware")

dpfernandes commented 4 years ago

Approved