-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathserver.js
58 lines (48 loc) · 1.13 KB
/
server.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env node
var http = require('http');
var express = require('express');
var BuzzerServer = require('./lib/BuzzerServer');
var app = express();
var server = http.createServer(app).listen(
process.env.port ? process.env.port : 3000, process.env.ip ? process.env.ip : undefined
);
BuzzerServer.listen(server);
//Publish the www directory
app.use(express.static(__dirname + '/www'));
//Get the index.html for the home page
app.get(
'/',
function(req, res) {
res.sendFile(__dirname + '/www/index.html');
}
);
app.get(
'/New',
function(req,res){
res.sendFile(__dirname + '/_private/CreateSession.html');
}
);
app.get(
'/Contestant',
function(req,res){
res.sendFile(__dirname + '/_private/ContestantScreen.html');
}
);
app.get(
'/Join',
function(req,res){
res.sendFile(__dirname + '/_private/JoinSession.html');
}
);
app.get(
'/Share',
function(req,res){
res.sendFile(__dirname + '/_private/PresentationScreen.html');
}
);
app.get(
'/Manage',
function(req,res){
res.sendFile(__dirname + '/_private/ManageSession.html');
}
);