This is a simple example of how to use multer and cloudinary to upload images to the cloud.
- Upload images to the cloud
- Get images from the cloud
- Delete images from the cloud
- Node.js
- NPM
- Cloudinary Account
- Multer
Clone this repository
git clone https://github.com/raprmdn/multer-cloudinary.git
Install the dependencies
npm install
Configure the environment variables.
Copy the .env.example
file to .env
and fill in the required values.
cp .env.example .env
Configure the cloudinary account.
Get CLOUDINARY_CLOUD_NAME
, CLOUDINARY_API_KEY
, and CLOUDINARY_API_SECRET
from your cloudinary account here.
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
Run the server
Note: Make sure you have installed global dependencies nodemon, sequelize.
# Create database
sequelize db:create
# Run migrations
sequelize db:migrate
# Run the application
# By default, the application will run on port 5000
npm run dev
- title
string
*required
- slug
string
*required
- photo
file
PNG, JPEG, JPG, GIF, SVG, and WEBP
*required