const express = require('express'); const courseController = require('../controllers/course'); // Routing Component const router = express.Router(); // Auth import const auth = require('../auth') // Auth const {verify,verifyAdmin} = auth; // verifyng router.post("/", verify,verifyAdmin, courseController.addCourse); router.get('/all', courseController.getAllCourses); router.get('/', courseController.getAllActive); // wild card = it is dynamic means can be change by it's ID router.get('/:courseId', courseController.getCourse); router.put("/:courseId", verify, verifyAdmin, courseController.updateCourse); router.put('/:courseId/archive', verify,verifyAdmin, courseController.archiveCourse) router.put('/:courseId/activate', verify, verifyAdmin, courseController.activateCourse) module.exports = router;