// catch 404 and forward to error handler
app.use(function(req, res, next) {
let err = new Error('Not Found');
err.status = 404;
console.error('WRONG:', '404 Not Found');
next(err);
});
As soon as you add this middleware, all requests will receive a new 404 error, and then throw it out. You need to add a restriction before throwing the error.
Make sure your
common.js
import path is correctConfirm whether an error is reported in your
requestCombine(req,res,next,x)
methodPersonally I think it’s your path problem
As soon as you add this middleware, all requests will receive a new 404 error, and then throw it out. You need to add a restriction before throwing the error.
It’s a grammatical error at first glance!