mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-22 16:05:03 +08:00
commit
46ee6515fa
11
index.js
11
index.js
@ -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
13
public/landing.html
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user