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;