forked from Jian-Kai/SocialMediaTrendVisualizationTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
38 lines (28 loc) · 876 Bytes
/
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
// import modules
var express = require('express'), // npm install express
app = express(),
async = require('async'),
fs = require("fs"),
readfile = require('./server/readfile.js');
//app.get('/crawler', crawlerExpressHandler.callback);
/*
app.get('/project', function(){
setTimeout(function() {
res.setHeader('transfer-encoding', 'chunked');
res.status(200);
util.log("timeout")
res.write("hello world");
res.end();
}, 3 * 60 * 1000)
});
*/
app.get('/compare', readfile.callback);
var port = process.env.PORT || 4000;
app.listen(port, function () {
console.log("Express server listening on port %d", port);
});
app.use(express.static(__dirname + '/'));
app.use(express.static(__dirname + '/html/'));
process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
});