-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (31 loc) · 992 Bytes
/
index.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
var express = require('express');
var sessions = require('client-sessions');
var bodyParser = require('body-parser');
var compression = require('compression');
var path = require('path');
var parseThings = require('./routes/parse');
var geocodeData = require('./routes/geocode');
var facebookData = require('./routes/facebook');
var app = express()
app.engine('.html', require('ejs').__express);
app.set('view engine', 'html');
app.use(compression());
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json({
limit: '1mb'
}));
app.use(bodyParser.urlencoded({
extended: false,
limit: '1mb'
}));
// route handlers go here
app.use(parseThings); // order matters!
app.use(geocodeData);
app.use(facebookData);
app.use(function(req, res, next) {
res.sendStatus(404);
});
app.set('port', process.env.PORT || 3000);
var clientServer = app.listen(app.get('port'), function() {
console.log('Express server listening on port %d', clientServer.address().port);
});