const express = require('express');
const router = express.Router();
const { uploadImage, saveImageDetails, getImages, getImagesByPage, getImageById, getImageByHash, updateImage } = require('../controllers/imageController');
const authMiddleware = require('../middleware/authMiddleware')

router.post('/', authMiddleware, uploadImage, saveImageDetails);
router.get('/', authMiddleware, getImages);
router.get('/page/:pageId', getImagesByPage);
router.get('/:id', getImageById);
router.put('/:id', authMiddleware, updateImage);
router.put('/hash/:id', getImageByHash);
module.exports = router;
