From 17b89099b36a63ed2854083cdb4cb06f47a41e14 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Wed, 20 Jan 2016 19:05:02 +0200 Subject: Refactor file structure --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 055b1c7..15c269f 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ var http = require('http').Server(app); var io = require('socket.io')(http); var port = (process.env.PORT || 5000); var LOGBROADCAST = true; + //get port from commandline parameteres if (process.argv.length == 3) { port = process.argv[2]; @@ -12,19 +13,18 @@ var que = []; var pws = {}; app.get('/', function(req, res) { - res.sendFile(__dirname + '/f/templates/index.html'); + res.sendFile(__dirname + '/templates/index.html'); }); app.get('/adm', function(req, res) { - res.sendFile(__dirname + '/f/templates/adm.html'); + res.sendFile(__dirname + '/templates/adm.html'); }); app.get('/log', function(req, res) { - res.sendFile(__dirname + '/f/templates/log.html'); + res.sendFile(__dirname + '/templates/log.html'); }); - //route all paths beginning with /f/ to real files app.get('/f/*', function(req, res) { - res.sendFile(__dirname + req.path); + res.sendFile(__dirname + req.path.substring(2)); }); -- cgit v1.3