mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-23 10:39:20 +08:00
Basic web page implementation
This commit is contained in:
parent
341e386dd8
commit
b884c60f95
11
index.js
11
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");
|
||||
});
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<body>
|
||||
<h1>Welcome to videochat</h1>
|
||||
<h3>Click the button to get a disposable video chat room</h3>
|
||||
<a href="index.html">Link</a>
|
||||
<a href="/">Link</a>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user