diff options
| author | okalintu <ilkka.oksanen@aalto.fi> | 2015-03-03 15:46:01 +0200 |
|---|---|---|
| committer | okalintu <ilkka.oksanen@aalto.fi> | 2015-03-03 15:46:01 +0200 |
| commit | 10eb4471ab820bb2323077cb7be8029a2e9b0759 (patch) | |
| tree | 0d3b77b065d46bd9657359d7e33f7e4c2881c323 /index.js | |
| parent | 6cb2891f117e29ea7adc68f62fe422285fc8364b (diff) | |
sanitized routes
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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(){ |
