Refresh function for main frontend, separate main frontends for normal countdown and score+countdown
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
let io = require('../controllers/socketio')
|
||||
const timer = require('../controllers/timer')
|
||||
let io = require('../controllers/socketio');
|
||||
const timer = require('../controllers/timer');
|
||||
const score = require('../controllers/score');
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function(req, res, next) {
|
||||
res.render('index', { durationLeft: timer.print()});
|
||||
if (score.getEnabled()) { // If scoreboard is enabled
|
||||
res.render('indexScore', {
|
||||
title: "Timer and Score",
|
||||
durationLeft: timer.print(),
|
||||
});
|
||||
} else { // If scoreboard is not enabled
|
||||
res.render('index', { title: "Timer", durationLeft: timer.print()})
|
||||
}
|
||||
});
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
|
||||
Reference in New Issue
Block a user