How to structure app.configure in Express
coffeescript, express, node.js
Solution
They're just executed in sequence. The first will be invoked for all environments, so it doesn't matter if it's wrapped with `configure()` at all; it just looks nicer. But if you look at the Express issue queue, they'll likely be disappearing in the future since they're effectively just glorified if statements.
Problem
I'm using Express 3.0 alpha to build an app but am a little confused with the app config structure ``` app.configure -> app.set "views", __dirname + "/views" app.set "view engine", "jade" app.use express.bodyParser() app.use express.methodOverride() app.configure "development", -> app.use express.logger("dev") app.configure "production", -> app.use express.logger() ``` Is the first `app.configure, ->` required? I've been browsing other people's apps and it doesn't seem to matter if I use it. How does ordering work for `app.configure, ->`? It seems correct to put the specific environments (development, and production) after the first `app.configure, ->` as I've seen in other apps but it doesn't seem to work with my app (i.e. the logger doesn't print anything in my console at all). Thanks in advance!