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

@ -1,5 +1,5 @@
[![view on npm](http://img.shields.io/npm/v/local-web-server.svg)](https://www.npmjs.org/package/local-web-server)
![npm module downloads per month](http://img.shields.io/npm/dm/local-web-server.svg)
[![npm module downloads per month](http://img.shields.io/npm/dm/local-web-server.svg)](https://www.npmjs.org/package/local-web-server)
[![Dependency Status](https://david-dm.org/75lb/local-web-server.svg)](https://david-dm.org/75lb/local-web-server)
![Analytics](https://ga-beacon.appspot.com/UA-27725889-12/local-web-server/README.md?pixel)

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 */

6
lib/stats.js Normal file
View File

@ -0,0 +1,6 @@
"use strict";
exports.requests = 0;
exports.transferred = 0;
exports.requests = 0;
exports.requests = 0;