Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade example to express 4.10 #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions examples/login/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ var express = require('express')
, http = require('http')
, passport = require('passport')
, util = require('util')
, LinkedInStrategy = require('passport-linkedin').Strategy;
, LinkedInStrategy = require('passport-linkedin').Strategy
, bodyParser = require('body-parser')
, expressLogger = require('express-logger')
, session = require('express-session')
, cookieParser = require('cookie-parser')
, methodOverride = require('method-override');

var app = express();

// configure Express
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.logger());
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.session({ secret: 'keyboard cat' }));
app.use(cookieParser());
app.use(bodyParser());
app.use(methodOverride());
app.use(session({ secret: 'keyboard cat' }));
// Initialize Passport! Also use passport.session() middleware, to support
// persistent login sessions (recommended).
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
app.use(express.static(__dirname + '/public'));

var LINKEDIN_API_KEY = "--insert-linkedin-api-key-here--";
var LINKEDIN_SECRET_KEY = "--insert-linkedin-secret-key-here--";
Expand Down Expand Up @@ -102,6 +104,8 @@ app.get('/logout', function(req, res){
res.redirect('/');
});

app.use(express.static(__dirname + '/public'));

http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
Expand Down
7 changes: 6 additions & 1 deletion examples/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"express": ">= 0.0.0",
"ejs": ">= 0.0.0",
"passport": ">= 0.0.0",
"passport-linkedin": ">= 0.0.0"
"passport-linkedin": ">= 0.0.0",
"body-parser" : "latest",
"express-logger" : "latest",
"express-session" : "latest",
"cookie-parser" : "latest",
"method-override" : "latest"
}
}