update
This commit is contained in:
28
routes/chapterRoutes.js
Normal file
28
routes/chapterRoutes.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const chapterController = require('../controllers/chapterController');
|
||||
|
||||
/**
|
||||
* Chapter Routes
|
||||
* Base path: /api/chapters
|
||||
*/
|
||||
|
||||
// Get all chapters
|
||||
router.get('/', chapterController.getAllChapters);
|
||||
|
||||
// Get chapter by ID
|
||||
router.get('/:id', chapterController.getChapterById);
|
||||
|
||||
// Get lessons in a chapter
|
||||
router.get('/:id/lessons', chapterController.getLessonsByChapter);
|
||||
|
||||
// Create new chapter
|
||||
router.post('/', chapterController.createChapter);
|
||||
|
||||
// Update chapter
|
||||
router.put('/:id', chapterController.updateChapter);
|
||||
|
||||
// Delete chapter
|
||||
router.delete('/:id', chapterController.deleteChapter);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user