Skip to content

raprmdn/multer-cloudinary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Multer Cloudinary

This is a simple example of how to use multer and cloudinary to upload images to the cloud.

Dependencies

Features

  • Upload images to the cloud
  • Get images from the cloud
  • Delete images from the cloud

Getting Started

Prerequisites

Installation

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

Usage

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

API Documentation

GET api/gallery - Get all images from the cloud

POST api/gallery - Upload image to the cloud

Request Body: Content-Type: multipart/form-data
  • title string *required
  • slug string *required
  • photo file PNG, JPEG, JPG, GIF, SVG, and WEBP *required

GET api/gallery/:slug - Get image from the cloud

DELETE api/gallery/:slug - Delete image from the cloud

About

Multer with upload to Cloudinary

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published