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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…