const cloudinary = require('cloudinary')


cloudinary.config({
    cloud_name: 'dyqmvr2xm',
    api_key: '764589824777525',
    api_secret: 'xs7VrClqX9qK7wayuGiw7Q73xFE'
});


const uploads = (file_path, folder) => {//file_path, folder_name
    return new Promise(resolve => {
        cloudinary.uploader.upload(file_path, (result) => {
            resolve(result)
        }, {
            resource_type: "auto",
            folder: folder
        })
    })
}


module.exports = { cloudinary, uploads };