Created
January 28, 2012 22:40
-
-
Save mikevalstar/1696049 to your computer and use it in GitHub Desktop.
Part 3.1 of the node tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express') | |
| , mongoStore = require('session-mongoose'); | |
| var app = module.exports = express.createServer(); | |
| // Configuration | |
| app.configure(function(){ | |
| app.set('views', __dirname + '/views'); | |
| app.set('view engine', 'jade'); | |
| app.use(express.bodyParser()); | |
| app.use(express.methodOverride()); | |
| app.use(express.cookieParser()); | |
| var mongooseSessionStore = new mongoStore({ | |
| url: "mongodb://localhost/mv", | |
| interval: 120000 | |
| }); | |
| app.use(express.session( {cookie: {maxAge: 120000}, store: mongooseSessionStore, secret: "mv secret" })); | |
| app.use(app.router); | |
| app.use(express.static(__dirname + '/htdocs')); | |
| }); | |
| // ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment