diff --git a/index.js b/index.js index b5c2cce..3928926 100644 --- a/index.js +++ b/index.js @@ -5,9 +5,19 @@ var express = require('express'); var app = express(); var http = require('http').createServer(app); var io = require('socket.io')(http); +var path = require('path'); +var public = path.join(__dirname, 'public'); app.use(express.static('public')); +app.get('/', function(req, res) { + res.sendFile(path.join(public, 'chat.html')); +}); + +app.get('/landing', function(req, res) { + res.sendFile(path.join(public, 'landing.html')); +}); + function log(msg, room) { console.log(room + ": " + msg) } @@ -71,3 +81,4 @@ io.on('connection', function (socket) { http.listen(3000, function () { console.log("http://localhost:3000"); }); + diff --git a/public/index.html b/public/chat.html similarity index 100% rename from public/index.html rename to public/chat.html diff --git a/public/landing.html b/public/landing.html index 4e21936..1cb9d98 100644 --- a/public/landing.html +++ b/public/landing.html @@ -7,7 +7,7 @@