Added splashscreen
This commit is contained in:
@@ -33,6 +33,23 @@ router.get('/killBrowser', function(req, res, next) {
|
||||
res.send(); // send empty response
|
||||
});
|
||||
|
||||
// ######################################################################################################################################################
|
||||
// Etc endpoints
|
||||
// ######################################################################################################################################################
|
||||
|
||||
// Express router endpoint to toggle splashscreen
|
||||
router.get('/etcToggleSplashscreen', function(req, res, next) {
|
||||
etc.toggleSplashScreen(); // Toggles splashscreen
|
||||
res.status(200); // Set http status code to 200 (success)
|
||||
res.json(etc.getValues()); // Answer with important values
|
||||
});
|
||||
|
||||
// Express router endpoint to get important etc values
|
||||
router.get('/etcGetValues', function(req, res, next) {
|
||||
res.status(200); // Set http status code to 200 (success)
|
||||
res.json(etc.getValues()); // Answer with important values
|
||||
});
|
||||
|
||||
// ######################################################################################################################################################
|
||||
// Timerendpoints
|
||||
// ######################################################################################################################################################
|
||||
|
||||
@@ -2,14 +2,19 @@ var express = require('express');
|
||||
var router = express.Router();
|
||||
let io = require('../controllers/socketio');
|
||||
|
||||
const score = require("../controllers/score");
|
||||
const score = require('../controllers/score');
|
||||
const etc = require('../controllers/etc');
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function(req, res, next) {
|
||||
if (score.getEnabled()) { // If scoreboard is enabled
|
||||
res.render('indexScore', {}); // Render the site with scoreboard
|
||||
} else { // If scoreboard is not enabled
|
||||
res.render('index', {}); // Render the site without scoreboard
|
||||
if(etc.getSplashscreen()) { // If splashscreen is enabled
|
||||
res.render('splashscreen', {}); // Render splashscreen
|
||||
} else {
|
||||
if (score.getEnabled()) { // If scoreboard is enabled
|
||||
res.render('indexScore', {}); // Render the site with scoreboard
|
||||
} else { // If scoreboard is not enabled
|
||||
res.render('index', {}); // Render the site without scoreboard
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user