Express 4.X
if (app.get('env') === 'development') {
app.locals.pretty = true;
}
Express 3.X
app.configure('development', function(){
app.use(express.errorHandler());
app.locals.pretty = true;
});
Express 2.X
app.configure('development', function(){
app.use(express.errorHandler());
app.set('view options', { pretty: true });
});
友情链接:查看原文