add "trust proxy"

This commit is contained in:
Matias Alejo Garcia 2015-04-18 13:32:21 -03:00
parent 355290040a
commit 56543d3907
1 changed files with 4 additions and 4 deletions

View File

@ -43,6 +43,7 @@ ExpressApp.start = function(opts) {
next();
}
app.use(allowCORS);
app.enable('trust proxy');
var POST_LIMIT = 1024 * 100 /* Max POST 100 kb */ ;
@ -50,15 +51,14 @@ ExpressApp.start = function(opts) {
limit: POST_LIMIT
}));
if (!opts.disableLogs) {
if (opts.disableLogs) {
log.level = 'silent';
} else {
// TODO access.log
//var accessLogStream = fs.createWriteStream(__dirname + '/access.log', {flags: 'a'})
//app.use(morgan('combined', {stream: accessLogStream}))
// app.use(require('morgan')('dev'));
app.use(require('morgan')(':remote-addr :date[iso] ":method :url" :status :res[content-length] :response-time ":user-agent" '));
} else {
log.level = 'silent';
}