Create Route – Step 8
Step 8: -Create Route
- Crete a new folder with name routes
- 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;