-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
executable file
·30 lines (24 loc) · 1.03 KB
/
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 express = require('express');
var app = express();
var port = process.env.PORT || 3000;
var passport = require('passport');
var http = require('http');
var path = require('path');
var server = http.createServer(app);
require('./config/passport')(passport) // pass passport for configuration
app.configure(function() {
// set up our express application
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.set('view engine', 'ejs'); // set up ejs for templating
app.use(express.static(path.join(__dirname, 'public')));
// required for passport
app.use(express.session({ secret: 'iloveharborjsiloveharborjs' })); // session secret
app.use(passport.initialize());
app.use(passport.session());
});
// routes ======================================================================
require('./app/routes.js')(app, passport); // load our routes and pass in our app and fully configured passport
server.listen(port);
console.log('aviie is running on port ' + port);