-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
59 lines (45 loc) · 1.17 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
59
const express = require('express');
const app = express();
const path = require('path');
const portno = 5000;
/*
const https = require('https');
var options = {
hostname: 'crest-tq.eveonline.com',
port: 443,
path: '/',
method: 'GET'
};
var req = https.request(options, function(res) {
console.log('statusCode:', res.statusCode);
console.log();
console.log('headers:', res.headers);
res.on('data', function(d) {
process.stdout.write(d);
console.log();
});
});
req.end();
req.on('error', function(e) {
console.error('failed');
console.error(e);
});
*/
////////////////////////////////////////////////////////
// viewed at http://localhost:portno
if (process.env.EVE_JS_PROD) {
console.log("prod setup");
app.use('/eve/static', express.static('static'));
app.get('/eve/', function(req, res) {
res.sendFile(path.join(__dirname + '/tournaments.html'));
});
}
else {
console.log("dev setup");
app.use('/static', express.static('static'));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/tournaments.html'));
});
}
app.listen(process.env.PORT || portno);
console.log("running on " + portno);