Merge pull request #2 from ianramzy/landing-page

Landing page
This commit is contained in:
Ian Ramzy 2020-03-22 13:53:59 -04:00 committed by GitHub
commit 46ee6515fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View File

@ -5,9 +5,19 @@ var express = require('express');
var app = express(); var app = express();
var http = require('http').createServer(app); var http = require('http').createServer(app);
var io = require('socket.io')(http); var io = require('socket.io')(http);
var path = require('path');
var public = path.join(__dirname, 'public');
app.use(express.static('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) { function log(msg, room) {
console.log(room + ": " + msg) console.log(room + ": " + msg)
} }
@ -71,3 +81,4 @@ io.on('connection', function (socket) {
http.listen(3000, function () { http.listen(3000, function () {
console.log("http://localhost:3000"); console.log("http://localhost:3000");
}); });

13
public/landing.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Landing</title>
</head>
<body>
<h1>Welcome to videochat</h1>
<h3>Click the button to get a disposable video chat room</h3>
<a href="/">Link</a>
</body>
</html>