-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (29 loc) · 887 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
var express = require('express');
var sessions = require('client-sessions');
var bodyParser = require('body-parser');
var compression = require('compression');
var fromOSX = require('./routes/fromOSX');
var fromIOS = require('./routes/fromIOS');
var path = require('path');
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(fromOSX);
app.use(fromIOS);
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);
});