|
@ -69,6 +69,12 @@ if (argv.Misc.config){ |
|
|
|
|
|
|
|
|
var app = connect(); |
|
|
var app = connect(); |
|
|
|
|
|
|
|
|
|
|
|
/* enable cross-origin requests on all resources */ |
|
|
|
|
|
app.use(function(req, res, next){ |
|
|
|
|
|
res.setHeader("Access-Control-Allow-Origin", "*"); |
|
|
|
|
|
next(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/* log using --log-format (if supplied) */ |
|
|
/* log using --log-format (if supplied) */ |
|
|
var logFormat = argv.Server["log-format"]; |
|
|
var logFormat = argv.Server["log-format"]; |
|
|
if(logFormat) { |
|
|
if(logFormat) { |
|
@ -91,6 +97,7 @@ if (argv.Misc.config){ |
|
|
/* if no `--log-format` was specified, pipe the default format output |
|
|
/* if no `--log-format` was specified, pipe the default format output |
|
|
into `log-stats`, which prints statistics to the console */ |
|
|
into `log-stats`, which prints statistics to the console */ |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
dope.hideCursor(); |
|
|
app.use(morgan({ stream: logStats({ refreshRate: argv.Server.refreshRate }) })); |
|
|
app.use(morgan({ stream: logStats({ refreshRate: argv.Server.refreshRate }) })); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|