如何最简单地告诉 Express 我正在使用哪个环境?例如,我想根据我的环境连接到 Redis,这可以从命令行完成吗?
app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
var r = require("redis").createClient(6379,'127.0.0.1');
});
app.configure('production', function(){
app.use(express.errorHandler());
r = redis.createClient(6379,'46.137.195.230', { detect_buffers: true });
});