mozilla/openbadges — pull request #802 by stenington (2013-03-27 18:33:25+00:00)
Title: Move NODE_ENV-based config to config files

It seems like `app.configure` seems to be a bit brittle in two ways:
* if you don't anticipate all environment names, you can end up accidentally omitting middleware altogether,
* you have to choose one config per environment and stick with it.

In staging it would be much more useful to be able to switch between prod-like and dev-like configs for QA and troubleshooting respectively. This pull moves as much `app.configure`-type stuff as possible into the config files.

Note: I'm deliberately ignoring the question of whether we want to move away from config files to ENV-based config. I think having some in one and some in the other is more annoying than putting it all in the files for now, then moving it all to ENV variables at once.

Also note, as far as I can tell, `express.errorHandler` just doesn't take options, and our dev/prod config there did nothing. See the following:
* http://www.senchalabs.org/connect/errorHandler.html
* https://github.com/senchalabs/connect/blob/master/lib/middleware/errorHandler.js
* https://groups.google.com/forum/?fromgroups=#!topic/express-js/n_Q17_KCAJc