import multer from "multer";
import util from "util";

const maxSize = 5 * 1024 * 1024;
const storage = multer.diskStorage({});

const upload = multer({
  storage,
  limits: { fileSize: maxSize },
}).single("file");

const uploadFilesMiddleware = util.promisify(upload);

export default uploadFilesMiddleware;
