-
Notifications
You must be signed in to change notification settings - Fork 3
/
server.js
30 lines (27 loc) · 974 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
var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var csrf = require('csurf');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var compress = require('compression');
var helmet = require('helmet');
var app = express();
var passport = require('passport');
var config = require('./config.json');
app.disable('x-powered-by');
app.use(bodyParser());
app.use(helmet.xframe());
app.use(helmet.iexss());
app.use(helmet.contentTypeOptions());
app.use(helmet.cacheControl());
app.use(cookieParser());
app.use(methodOverride());
app.use(session(config.express.sessions));
app.use(csrf());
app.use(compress());
app.use(passport.initialize());
app.use(passport.session());
app.use(express.static(path.join(__dirname, 'public')));
module.exports = app