Jenderal92

Untitled

Jul 22nd, 2022
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //category.routes.js
  2.  
  3. module.exports = (app) => {
  4. const category = require('../controllers/category.controller.js');
  5.  
  6. // Create a new Category
  7. app.post('/category', category.create);
  8.  
  9. // Retrieve all Categorys
  10. app.get('/category', category.findAll);
  11.  
  12. // Retrieve a single Category with categoryId
  13. app.get('/category/:categoryId', category.findOne);
  14.  
  15. // Update a Category with categoryId
  16. app.put('/category/:categoryId', category.update);
  17.  
  18. // Delete a Category with categoryId
  19. app.delete('/category/:categoryId', category.delete);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment