Added Salvi's backend folder from backend branch to allow ombase to continue testing.

This commit is contained in:
K
2025-02-23 09:05:16 +05:30
parent 3f9e6d3dee
commit 7da2809399
28 changed files with 6979 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const cloudinary = require("cloudinary").v2;
const fs = require("fs");
const uploadOnCloudinary = async (localFilePath) => {
try {
if (!localFilePath) return null;
const responce = await cloudinary.uploader.upload(localFilePath, {
resource_type: "auto",
});
// console.log("File is uploaded successfully");
fs.unlinkSync(localFilePath, () => {
console.log("file removed successfully");
});
return responce.url;
} catch (error) {
fs.unlinkSync(localFilePath);
console.log("file removed successfully");
return null;
}
};
module.exports = { uploadOnCloudinary };