import express from 'express';
import { auth } from '../../middleware/auth';
import { multerUpload } from '../../services/s3Service';
import { handleBufferUpload, handleFileUpload, handleUrlToImageUpload } from './controllers/upload';

const router = express.Router();

// Route for uploading image from a file
router.post('/upload-url', auth, multerUpload, handleFileUpload);

// Route for uploading image from a URL
router.post('/upload-from-url', auth, handleUrlToImageUpload);

// Route for uploading from a buffer
router.post('/upload-buffer', auth, handleBufferUpload);

export default router;