-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebmain.js
More file actions
34 lines (25 loc) · 722 Bytes
/
webmain.js
File metadata and controls
34 lines (25 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.set('view engine', 'ejs');
app.use(express.static('public'));
exports = module.exports = {};
exports.rtc = require('./rtc');
var location;
exports.init = function(){
// index page
app.get('/', function(req, res) {
res.render('pages/index');
});
this.rtc.init(io);
//RTC Events from Website
this.rtc.event.on('connection', function(){
console.log('User connected')
});
this.rtc.event.on('disconnect', function(){
console.log('User disconnected')
});
http.listen(8000);
console.log('8000 is the magic port');
};