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:
parent
770c5c9879
commit
18ee991ce3
16 changed files with 264 additions and 178 deletions
|
@ -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;
|
|
@ -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();
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue