Skip to content

Instantly share code, notes, and snippets.

import mongoose, {Schema} from "mongoose"
const wallpaperschema = new Schema(
{
title:{
type:String,
unique:true,
required:true
},
import wallpaper from "../models/wallpaper.js";
import { uploadOnCloudinary } from "../middlewares/cloudinary.js";
const createwp = async (req, res) => {
try {
const { title, category, success } = req.body;
const imageFile = req.file?.path;
// console.log(req.body);
// console.log(imageFile);
// console.log(process.env.CLOUDINARY_API_KEY);