这是我的应用程序,目前正在生产中。
var app = express();
app.set('views',settings.c.WEB_PATH + '/public/templates');
app.set('view engine','ejs');
app.configure(function(){
app.use(express.favicon());
app.use(express.static(settings.c.WEB_PATH + '/public'));
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.methodOverride());
app.use(express.session({
cookie:{ domain:"."+settings.c.SITE_DOMAIN, maxAge:1440009999},
secret:'hamster',
store: r_store,
}));
app.use(useragent.express());
app.use(flash());
app.use(passport.initialize());
app.use(passport.session());
});
但是,我开始了解NODE_ENV
并想要使用它。我怎样才能做到这一点?
app.configure('development', ...)
“生产”或“生产”来为开发或生产环境设置某些设置。参见expressjs.com/api.html#app.configure