Merge branch 'dev' into docs/swagger-autogen
This commit is contained in:
commit
5986ca57bf
189 changed files with 6160 additions and 1581 deletions
|
@ -1,8 +1,5 @@
|
|||
import express from 'express';
|
||||
import {
|
||||
getAllLearningObjects,
|
||||
getLearningObject,
|
||||
} from '../controllers/learningObjects.js';
|
||||
import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObjectHTML } from '../controllers/learning-objects.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
@ -24,4 +21,16 @@ 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);
|
||||
|
||||
// Parameter: hruid of learning object, name of attachment.
|
||||
// Query: language, version (optional).
|
||||
// Route to get the raw data of the attachment for one learning object based on its hruid.
|
||||
// Example: http://localhost:3000/learningObject/u_test/attachment/testimage.png
|
||||
router.get('/:hruid/html/:attachmentName', getAttachment);
|
||||
|
||||
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();
|
||||
|
|
@ -15,8 +15,7 @@ router.get('/:id', (req, res) => {
|
|||
student: '0',
|
||||
group: '0',
|
||||
time: new Date(2025, 1, 1),
|
||||
content:
|
||||
'Zijn alle gehele getallen groter dan 2 gelijk aan de som van 2 priemgetallen????',
|
||||
content: 'Zijn alle gehele getallen groter dan 2 gelijk aan de som van 2 priemgetallen????',
|
||||
learningObject: '0',
|
||||
links: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
|
|
35
backend/src/routes/router.ts
Normal file
35
backend/src/routes/router.ts
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { Response, Router } from 'express';
|
||||
import studentRouter from './student';
|
||||
import groupRouter from './group';
|
||||
import assignmentRouter from './assignment';
|
||||
import submissionRouter from './submission';
|
||||
import classRouter from './class';
|
||||
import questionRouter from './question';
|
||||
import authRouter from './auth';
|
||||
import themeRoutes from './themes';
|
||||
import learningPathRoutes from './learning-paths';
|
||||
import learningObjectRoutes from './learning-objects';
|
||||
import { getLogger, Logger } from '../logging/initalize';
|
||||
|
||||
const router = Router();
|
||||
const logger: Logger = getLogger();
|
||||
|
||||
router.get('/', (_, res: Response) => {
|
||||
logger.debug('GET /');
|
||||
res.json({
|
||||
message: 'Hello Dwengo!🚀',
|
||||
});
|
||||
});
|
||||
|
||||
router.use('/student', studentRouter /* #swagger.tags = ['Student'] */);
|
||||
router.use('/group', groupRouter /* #swagger.tags = ['Group'] */);
|
||||
router.use('/assignment', assignmentRouter /* #swagger.tags = ['Assignment'] */);
|
||||
router.use('/submission', submissionRouter /* #swagger.tags = ['Submission'] */);
|
||||
router.use('/class', classRouter /* #swagger.tags = ['Class'] */);
|
||||
router.use('/question', questionRouter /* #swagger.tags = ['Question'] */);
|
||||
router.use('/auth', authRouter /* #swagger.tags = ['Auth'] */);
|
||||
router.use('/theme', themeRoutes /* #swagger.tags = ['Theme'] */);
|
||||
router.use('/learningPath', learningPathRoutes /* #swagger.tags = ['Learning Path'] */);
|
||||
router.use('/learningObject', learningObjectRoutes /* #swagger.tags = ['Learning Object'] */);
|
||||
|
||||
export default router;
|
Loading…
Add table
Add a link
Reference in a new issue