https://github.com/rishika105/file-upload-express
A mini backend project that depicts how we can upload files like photos and videos using cloudinary.
https://github.com/rishika105/file-upload-express
cloudinary express-js mongodb node-js
Last synced: 2 months ago
JSON representation
A mini backend project that depicts how we can upload files like photos and videos using cloudinary.
- Host: GitHub
- URL: https://github.com/rishika105/file-upload-express
- Owner: rishika105
- Created: 2024-06-04T14:44:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-20T04:45:04.000Z (9 months ago)
- Last Synced: 2025-02-13T06:43:02.136Z (4 months ago)
- Topics: cloudinary, express-js, mongodb, node-js
- Language: JavaScript
- Homepage:
- Size: 1.29 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# File Upload with Cloudinary(Express)
## About
This is a mini backend project that demonstrates how to upload files, such as photos and videos, to Cloudinary. The project is built using Node.js, Express.js, and MongoDB, with Cloudinary as the cloud storage provider.## Features
- File upload functionality (photos and videos)
- Integration with Cloudinary for file storage
- RESTful API for handling file uploads
- MongoDB for managing uploaded file metadata## Technologies Used
- **Node.js** - Server-side JavaScript runtime
- **Express.js** - Web framework for building the backend
- **MongoDB** - NoSQL database for storing metadata of uploaded files
- **Cloudinary** - Cloud storage service for handling file uploads## Installation
1. **Clone the repository:**
```bash
git clone https://github.com/rishika105/file-upload-express.git
```2. **Install dependencies:**
```bash
npm install
```3. **Set up environment variables:**
Create a `.env` file in the root directory and add your MongoDB URI and Cloudinary credentials:
```env
MONGODB_URL=your-mongodb-uri
CLOUD_NAME=your-cloudinary-cloud-name
API_KEY=your-cloudinary-api-key
API_SECRET=your-cloudinary-api-secret
PORT= 4000
```4. **Run the application:**
```bash
npm start
```## Endpoints
- **POST /localFileUpload** - Upload a file to Cloudinary and store its metadata in MongoDB.
- **POST /imageUpload** - Upload a image to Cloudinary and store its metadata in MongoDB.
- **POST /videoUpload** - Upload a video to Cloudinary and store its metadata in MongoDB.
- **POST /imageSizeReducer** - Reduce a image size already stored in cloudinary.