Added comments, incDec function

This commit is contained in:
2024-05-17 21:17:52 +02:00
parent 9f845ea234
commit 35a0785bf3
3 changed files with 39 additions and 5 deletions
+6 -3
View File
@@ -31,7 +31,12 @@ router.post('/timerReset', function(req, res, next) {
res.json(timer.getValues()); // Respond with all important values to update the frontend
});
// Express router endpoint to switch the score after halftime
router.post('/timerIncDec', function(req, res, next) {
timer.incDec(req.body.value);
res.json(timer.getValues());
});
// Express router endpoint to get important timer values
router.get('/timerGetValues', function(req, res, next) {
res.json(timer.getValues()); // Respond with important values for frontend
});
@@ -46,6 +51,4 @@ router.get('/', function(req, res, next) {
res.render('admin');
});
module.exports = router;