Browse Source

Merge pull request #190 from matiu/feat/proxy

add "trust proxy"
activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
a28abbb438
  1. 8
      lib/expressapp.js

8
lib/expressapp.js

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

Loading…
Cancel
Save