jaredhanson / passport-http-bearer

HTTP Bearer authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-http-bearer/?utm_source=github&utm_medium=referral&utm_campaign=passport-http-bearer&utm_content=about
MIT License
951 stars 142 forks source link

Example is not working #24

Closed pavelbinar closed 9 years ago

pavelbinar commented 10 years ago

I think it is because if new version of Express.js and its new way is creating and configuring server.

node app.js
/Users/pavelbinar/git/pavelbinar/email-analytics/passport-http-bearer/examples/bearer/app.js:76
var app = express.createServer();
                  ^
TypeError: undefined is not a function
    at Object.<anonymous> (/Users/pavelbinar/git/pavelbinar/email-analytics/passport-http-bearer/examples/bearer/app.js:76:19)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Function.Module.runMain (module.js:490:10)
    at startup (node.js:124:16)
    at node.js:807:3
kuldeeparora commented 9 years ago

express.createServer() is deprecated, express applications no longer inherit from http.Server. please use
var express = require("express"); var app = express();

jaredhanson commented 9 years ago

Express 4.x example is here: https://github.com/passport/express-4.x-http-bearer-example