-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
36 lines (32 loc) · 997 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'),
session = require('express-session'),
bodyParser = require('body-parser'),
app = express(),
server = app.listen(8000, "localhost",
function(){
var host = server.address().address;
var port = server.address().port;
console.log('Example app is listening at http://%s:%s', host, port);
});
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.use(require('method-override')()); //to use put and delete HTTP requests
app.use(express.static(__dirname + '/public'));
console.log('info:', 'Setting up sessions...');
app.use(
session({
secret: 'wh01sn3xt',
name: 't3l3tub13s',
resave: true,
rolling: true,
saveUninitialized: true,
cookie: {
maxAge: 7200000 //2 hours
}
})
);
app.use(require(__dirname + '/lib/Parser')());
app.use(require(__dirname + '/lib/HeaderCheck')());
app.use(require(__dirname + '/config/Router')(express.Router()));