Image Base URL

http://localhost:8000/api/image

All routes below are prefixed with this base URL.

1️⃣ Upload Image

POST /upload 🔒 JWT Required

Headers

Authorization: Bearer Content-Type: multipart/form-data

Body (form-data)

Key: file (Type: File)

cURL Example

curl -X POST http://localhost:8000/api/image/upload -H "Authorization: Bearer YOUR_TOKEN" -F "file=@image.jpg"

Success Response (200)

{ "message": "Image uploaded successfully", "data": { "imageUrl": "https://res.cloudinary.com/your-image.jpg", "size": 204800, "type": "image/jpeg" } }

Error Responses

400 → No image uploaded 500 → Internal Server Error