Create Route – Step 8

Create Route – Step 8

Step 8: -Create Route

  1. Crete a new folder with name routes
  2. Create a new file inside folder route with any name like teamMember.js
const express =  require('express');

const { createMember,getAllMembers,readSingleMember,updateSingleMember,deleteSingleMember } = require('../controllers/teamMember');
    
const router =express.Router();

router.route('/create').post(createMember);
router.route('/readAllMembers').get(getAllMembers);
router.route('/readSingleMember/:id').get(readSingleMember);
router.route('/updateSingleMember/:id').put(updateSingleMember);
router.route('/deleteSingleMember/:id').delete(deleteSingleMember);

module.exports=router;

Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

*

*