-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
46 lines (35 loc) · 1.26 KB
/
app.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
//Author: Ethan Pavolik [email protected]
var app = require('express')();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var favicon = require('serve-favicon');
var hashmap = require('hashmap');
var serverDraw = require('./serverDraw.js')(io, hashmap);
app.use(favicon(__dirname + '/static/favicon.ico'));
app.get('/', function(req, res) {
res.sendFile(__dirname + '/index.html');
});
app.get('/style/main.css', function(req, res) {
res.sendFile(__dirname + '/style/main.css');
});
app.get('/style/loginPage.css', function(req, res) {
res.sendFile(__dirname + '/style/loginPage.css');
});
app.get('/scripts/clientDraw.js', function(req, res) {
res.sendFile(__dirname + '/scripts/clientDraw.js');
});
app.get('/scripts/index.js', function(req, res) {
res.sendFile(__dirname + '/scripts/index.js');
});
app.get('/scripts/socketListeners.js', function(req, res) {
res.sendFile(__dirname + '/scripts/socketListeners.js');
});
app.get('/scripts/eventListeners.js', function(req, res) {
res.sendFile(__dirname + '/scripts/eventListeners.js');
});
app.get('/static/save.png', function(req, res) {
res.sendFile(__dirname + '/static/save.png');
});
var port = (process.env.PORT || '3000');
app.set('port', port);
server.listen(port);