personal_website/routes/photoRoutes.js
2023-06-25 00:46:46 +02:00

21 lines
568 B
JavaScript

var express = require('express');
// Vključimo multer za file upload
var multer = require('multer');
var upload = multer({dest: 'public/UpImage/'});
var router = express.Router();
var photoController = require('../controllers/photoController.js');
router.get('/', photoController.list);
router.get('/publish', photoController.publish);
router.get('/:id', photoController.show);
router.post('/', upload.single('image'), photoController.create);
router.put('/:id', photoController.update);
router.delete('/:id', photoController.remove);
module.exports = router;