summaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorokalintu <ilkka.oksanen@aalto.fi>2015-03-03 15:46:01 +0200
committerokalintu <ilkka.oksanen@aalto.fi>2015-03-03 15:46:01 +0200
commit10eb4471ab820bb2323077cb7be8029a2e9b0759 (patch)
tree0d3b77b065d46bd9657359d7e33f7e4c2881c323 /index.js
parent6cb2891f117e29ea7adc68f62fe422285fc8364b (diff)
sanitized routes
Diffstat (limited to 'index.js')
-rw-r--r--index.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/index.js b/index.js
index 3e06e9a..b4d50e1 100644
--- a/index.js
+++ b/index.js
@@ -5,15 +5,18 @@ var io = require('socket.io')(http);
var que = []
app.get('/', function(req, res){
- res.sendFile(__dirname + '/index.html');
-});
-app.get('/client.js', function(req, res){
- res.sendFile(__dirname + '/client.js');
+ res.sendFile(__dirname + '/f/templates/index.html');
});
app.get('/adm', function(req, res){
- res.sendFile(__dirname + '/adm.html');
+ res.sendFile(__dirname + '/f/templates/adm.html');
+});
+
+//route all paths beginning with /f/ to real files
+app.get('/f/*', function(req, res){
+ res.sendFile(__dirname + req.path);
});
+
io.on('connection', function(socket){
socket.emit("quedata",que);
@@ -29,6 +32,7 @@ io.on('connection', function(socket){
});
+
});
http.listen(3000, function(){