promptbackend / routes /categoryRoutes.js
samlax12's picture
Upload 19 files
4c025e9 verified
raw
history blame contribute delete
520 Bytes
const express = require('express');
const router = express.Router();
const {
getCategories,
getCategoryById,
createCategory,
updateCategory,
deleteCategory,
} = require('../controllers/categoryController');
const { protect } = require('../middleware/auth');
router.route('/')
.get(protect, getCategories)
.post(protect, createCategory);
router.route('/:id')
.get(protect, getCategoryById)
.put(protect, updateCategory)
.delete(protect, deleteCategory);
module.exports = router;