Cleanup, comments, removed ejs stuff

This commit is contained in:
2024-05-17 22:21:43 +02:00
parent 50dd893b5a
commit faaa47a792
6 changed files with 92 additions and 26 deletions
+12
View File
@@ -5,6 +5,10 @@ const io = require('../controllers/socketio');
const timer = require('../controllers/timer');
const score = require('../controllers/score');
// ######################################################################################################################################################
// General endpoints
// ######################################################################################################################################################
// Express router endpoint to trigger a frontend refresh on all connected sockets
router.get('/refreshMonitor', function(req, res, next) {
console.log("Monitor neu geladen");
@@ -13,6 +17,10 @@ router.get('/refreshMonitor', function(req, res, next) {
res.send(); // send empty response
});
// ######################################################################################################################################################
// Timerendpoints
// ######################################################################################################################################################
// Express router entpoint to start the timer
router.get('/timerStart', function(req, res, next) {
if(timer.start()) { // If successfully started the timer
@@ -51,6 +59,10 @@ router.get('/timerGetValues', function(req, res, next) {
res.json(timer.getValues()); // Respond with important values for frontend
});
// ######################################################################################################################################################
// Scoreboard endpoints
// ######################################################################################################################################################
// Express router endpoint to toggle the scoreboard
router.get('/scoreToggle', function(req, res, next) {
if(score.getEnabled()) { // If scoreboard enabled