Created
April 3, 2013 12:55
-
-
Save jbrooksuk/5300966 to your computer and use it in GitHub Desktop.
This file contains 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
app.configure(function() { | |
app.set('views', __dirname + '/public/views'); | |
app.set('view engine', 'jade'); | |
app.set('view options', { | |
layout: true | |
}); | |
app.use(function(req, res, next) { | |
res.locals.stripePublishable = config.stripe.publishable; | |
res.locals.copyrightYear = new Date().getFullYear(); | |
next(); | |
}); | |
app.use(express.favicon()); | |
app.use(express.logger('dev')); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(express.cookieParser()); | |
app.use(express.session( { secret: "somerandomkey" } )); | |
app.use(express.vhost('api.example.com', require('./lib/subdomains/api').api)); | |
app.use(app.router); | |
app.use(express.static(__dirname + '/public')); | |
app.use(function(req, res, next) { | |
// console.log('req.session', req.session.messages); | |
var msgs = req.session.messages || []; | |
res.locals({ | |
messages: msgs, | |
hasMessages: !! msgs.length, | |
}); | |
req.session.messages = []; | |
next(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment