I found some code where they set up Express without using app.configure
and I was wondering, what's the difference between using app.configure
without an environment specifier and not using it?
In other words, what's the difference between this:
var app = require(express);
app.configure(function(){
app.set('port', process.env.PORT || config.port);
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'site')));
}
and this:
var app = require(express);
app.set('port', process.env.PORT || config.port);
app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'site')));
Thanks.
app.configure
had to be used in older express versions but not now.require
theexpress
should be inquotes'
.