text: const multer  = require('multer');
  const storage = multer.diskStorage({
      destination: (req, file, cb) => {
        cb(null, './public/images');
      },
      filename: (req, file, cb) => {
        console.log(file);
        var filetype = '';
        if(file.mimetype === 'image/gif') {
          filetype = 'gif';
        }
        if(file.mimetype === 'image/png') {
          filetype = 'png';
        }
        if(file.mimetype === 'image/jpeg') {
          filetype = 'jpg';
        }
        cb(null, 'image-' + Date.now() + '.' + filetype);
      }
  });
  
  
  
  
  
  
  const multerUpload = multer({storage: storage});
  
  
  
  
  
  module.exports = {
      upload: async function (req, res, next) {
          multerUpload.single('file');
          return next();
      }
  }
  
  // function uploadImage(req, res) {
      
  // }
  