0

这是我在 app.js 中的配置

app.set('port',26000 || process.env.PORT);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser({uploadDir:'./public/uploads/'}));
app.use(express.cookieParser('impresionesbr'));
app.use(express.session());
app.use(passport.initialize());
app.use(passport.session());

app.configure('development', function(){
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
    app.use(express.errorHandler());
});

app.listen(26000,'localhost', function(){
    console.log("Express server listening on port %d in %s mode", app.get('port'),
    app.settings.env);
});

但我对如何配置护照有一些疑问,在下一个文件中我有一个替代上一个

app2.js

app.set('port',26000 || process.env.PORT);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser({uploadDir:'./public/uploads/'}));
app.use(express.cookieParser('impresionesbr'));
//app.use(express.session());
app.use(passport.session());
app.use(passport.initialize());

app.listen(26000,'localhost', function(){
    console.log("Express server listening on port %d in %s mode", app.get('port'),
    app.settings.env);
});

什么是开发和生产配置???

如果我丢掉那些物品会发生什么?

tnx

4

0 回答 0