From 341e386dd8bda0484f308f908d00e20f498b2a27 Mon Sep 17 00:00:00 2001 From: ian ramzy Date: Sun, 22 Mar 2020 13:09:56 -0400 Subject: [PATCH 1/2] create landing --- public/landing.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 public/landing.html diff --git a/public/landing.html b/public/landing.html new file mode 100644 index 0000000..4e21936 --- /dev/null +++ b/public/landing.html @@ -0,0 +1,13 @@ + + + + + Landing + + +

Welcome to videochat

+

Click the button to get a disposable video chat room

+Link + + + \ No newline at end of file From b884c60f95ac1e1cb2a5fd9eaa3329090b29fcc3 Mon Sep 17 00:00:00 2001 From: ian ramzy Date: Sun, 22 Mar 2020 13:36:29 -0400 Subject: [PATCH 2/2] Basic web page implementation --- index.js | 11 +++++++++++ public/{index.html => chat.html} | 0 public/landing.html | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) rename public/{index.html => chat.html} (100%) 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 @@

Welcome to videochat

Click the button to get a disposable video chat room

-Link +Link \ No newline at end of file