feat(backend): Added endpoint to fetch HTML version of learning object (from Dwengo backend)

Also refactored a bit to make this easier.
This commit is contained in:
Gerald Schmittinger 2025-03-04 22:35:05 +01:00
parent 770c5c9879
commit 18ee991ce3
16 changed files with 264 additions and 178 deletions

View file

@ -1,8 +1,8 @@
import express from 'express';
import {
getAllLearningObjects,
getLearningObject,
} from '../controllers/learningObjects.js';
getLearningObject, getLearningObjectHTML,
} from '../controllers/learning-objects.js';
const router = express.Router();
@ -24,4 +24,10 @@ router.get('/', getAllLearningObjects);
// Example: http://localhost:3000/learningObject/un_ai7
router.get('/:hruid', getLearningObject);
// Parameter: hruid of learning object
// Query: language, version (optional)
// Route to fetch the HTML rendering of one learning object based on its hruid.
// Example: http://localhost:3000/learningObject/un_ai7/html
router.get('/:hruid/html', getLearningObjectHTML);
export default router;

View file

@ -1,5 +1,5 @@
import express from 'express';
import { getLearningPaths } from '../controllers/learningPaths.js';
import { getLearningPaths } from '../controllers/learning-paths.js';
const router = express.Router();