-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
38 lines (31 loc) · 1.11 KB
/
app.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
//setup Dependencies
var express = require('express'),
port = 4000,
server = express();
var dust = require('dustjs-linkedin'),
helpers = require('dustjs-helpers'),
cons = require('consolidate');
require('./lib/dustHelpers');
var passport = require('passport');
server.configure(function(){
server.set('views', __dirname + '/static/views');
server.set('view options', { layout: false });
server.engine('dust', cons.dust);
server.set('view engine', 'dust');
server.locals({title: 'grouptones'});
server.use(express.compress());
server.use(express.static(__dirname + '/static'));
server.use(express.bodyParser());
server.use(express.cookieParser());
server.use(express.cookieSession({ secret: 'Push uffizi drive me to firenze', cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 }}));
server.use(passport.initialize());
server.use(passport.session());
server.use(server.router);
});
require('./lib/passport')();
require('./lib/routes')(server);
if (process.env.NODE_ENV === 'development') {
port = 5000;
}
server.listen(port);
console.log('Listening on localhost:' + port);