minor refactor

This commit is contained in:
Lloyd Brookes
2014-06-08 20:19:50 +01:00
parent e079cb3a2a
commit d2b151ab85
3 changed files with 14 additions and 8 deletions

View File

@ -27,6 +27,13 @@ function halt(message){
process.exit(1);
}
/* customised logger :date token, purely to satisfy Logstalgia. */
morgan.token("date", function(){
var a = new Date();
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
.replace("GMT", "").replace(" (BST)", "");
});
/* Merge together options from
- ~/.local-web-server.json
- {cwd}/.local-web-server.json
@ -74,13 +81,6 @@ if (argv.config){
process.exit(0);
});
/* customised logger :date token, purely to satisfy Logstalgia. */
morgan.token("date", function(){
var a = new Date();
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
.replace("GMT", "").replace(" (BST)", "");
});
var app = connect();
/* log using --log-format (if supplied), else output statics */