Cleanup, comments, removed ejs stuff
This commit is contained in:
parent
50dd893b5a
commit
faaa47a792
6 changed files with 92 additions and 26 deletions
|
|
@ -1,19 +1,16 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
let io = require('../controllers/socketio');
|
||||
const timer = require('../controllers/timer');
|
||||
const score = require('../controllers/score');
|
||||
|
||||
const score = require("../controllers/score");
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function(req, res, next) {
|
||||
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()})
|
||||
}
|
||||
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
|
||||
}
|
||||
});
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
|
|
@ -21,9 +18,8 @@ io.on('connection', (socket) => {
|
|||
socket.emit("Hello user from server");
|
||||
|
||||
socket.on('message', (message) => {
|
||||
console.log(message)
|
||||
console.log(message)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue