text: const notFound = (req, res, next) => {
    const error = new Error(`Not Found - ${req.originalUrl}`);
  
    res.status(404);
    next(error);
  };
  
  const errorHandler = (err, req, res, next) => {
    console.log(`${err.message}`);
    const statusCode = res.statusCode === 200 ? 500 : res.statusCode;
    res.status(statusCode).json({
      status: res.statusCode === 200 ? 500 : res.statusCode,
      message: err.message,
      stack: process.env.NODE_ENV === 'production' ? null : err.stack,
    });
  };
  
  export { notFound, errorHandler };
  