On making changes and saving .ejs file all working good in .js file when saving issue !!! cannot get /URL

0
711
// catch 404 and forward to error handler
app.use(function (req, res, next) {
  console.log('you have 404 on ', req.originalUrl);
  next(createError(404));
});

app.use((err, req, res, next) => {
  console.log('you have err on ', req.originalUrl, err);
  if (err.status !== 403) return next();
  res.send('403 error :: Invalid Token');
});

Use above code to debug where you make a mistake in my case one variable which is include in header is undefined after every load of any .JS file 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here