mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-24 13:39:35 +02:00
Category model and controllers
This commit is contained in:
parent
5c948e1a68
commit
100f274d96
8 changed files with 164 additions and 4 deletions
23
routes/category.js
Normal file
23
routes/category.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
const {
|
||||
createCategory,
|
||||
getCategories,
|
||||
getCategory,
|
||||
updateCategory,
|
||||
deleteCategory
|
||||
} = require('../controllers/category');
|
||||
|
||||
router
|
||||
.route('/')
|
||||
.post(createCategory)
|
||||
.get(getCategories);
|
||||
|
||||
router
|
||||
.route('/:id')
|
||||
.get(getCategory)
|
||||
.put(updateCategory)
|
||||
.delete(deleteCategory);
|
||||
|
||||
module.exports = router;
|
Loading…
Add table
Add a link
Reference in a new issue