jaredhanson/passport — Issue #4: express.static usage
Author: erhangundogan
Created: 2011-12-25 15:43:20+00:00
State: open

Hi jared.

First of all i want to say that passport is a great auth library. It's simple yet powerful one. Keep up your good work.

Let me ask you something about passport in general. In connect/express application i'm using static route handler before your initialize/session handlers (code below) to reduce serialization overhead. Is it good or bad practise?

```javascript
app.use(express.logger());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use("/public", express.static(__dirname + "/public")); // static route handler above others
app.use(express.session({
secret: "your secret",
maxAge: new Date(Date.now() + 3600000),
store: new mongoStore({ db: MongoDbConnection, collection: dbConfig.collection })
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
```