projects
/
qomet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add blur + resize monitoring in exam mode
[qomet.git]
/
bin
/
www
diff --git
a/bin/www
b/bin/www
index
c964949
..
36f54dd
100755
(executable)
--- a/
bin/www
+++ b/
bin/www
@@
-4,28
+4,28
@@
* Module dependencies.
*/
* Module dependencies.
*/
-
var
app = require('../app');
-
var
http = require('http');
+
const
app = require('../app');
+
const
http = require('http');
/**
* Get port from environment and store in Express.
*/
/**
* Get port from environment and store in Express.
*/
-
le
t port = normalizePort(process.env.PORT || '3000');
+
cons
t port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
app.set('port', port);
/**
* Create HTTP server.
*/
-
le
t server = http.createServer(app);
+
cons
t server = http.createServer(app);
/*
* CRON tasks
*/
/*
* CRON tasks
*/
-
var
cron = require('node-cron');
-
var
UserModel = require("../models/user");
+
const
cron = require('node-cron');
+
const
UserModel = require("../models/user");
cron.schedule('0 0 0 * * *', function() {
// Remove unlogged users every 24h
UserModel.cleanUsersDb();
cron.schedule('0 0 0 * * *', function() {
// Remove unlogged users every 24h
UserModel.cleanUsersDb();
@@
-38,8
+38,7
@@
cron.schedule('0 0 0 * * *', function() {
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
-let io = require('socket.io').listen(server); //sockets too
-//https://stackoverflow.com/a/24610678/4640434
+const io = require('socket.io').listen(server);
/*
* Sockets handling
/*
* Sockets handling
@@
-53,7
+52,7
@@
require('../sockets')(io);
function normalizePort(val)
{
function normalizePort(val)
{
-
le
t port = parseInt(val, 10);
+
cons
t port = parseInt(val, 10);
if (isNaN(port)) // named pipe
return val;
if (isNaN(port)) // named pipe
return val;
@@
-73,7
+72,7
@@
function onError(error)
if (error.syscall !== 'listen')
throw error;
if (error.syscall !== 'listen')
throw error;
-
le
t bind = typeof port === 'string'
+
cons
t bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
? 'Pipe ' + port
: 'Port ' + port;
@@
-99,8
+98,8
@@
function onError(error)
function onListening()
{
function onListening()
{
-
le
t addr = server.address();
-
le
t bind = typeof addr === 'string'
+
cons
t addr = server.address();
+
cons
t bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
console.log('Listening on ' + bind);
? 'pipe ' + addr
: 'port ' + addr.port;
console.log('Listening on ' + bind);