Browse Source

minor refactor

master
Lloyd Brookes 11 years ago
parent
commit
d2b151ab85
  1. 2
      README.md
  2. 14
      bin/ws.js
  3. 6
      lib/stats.js

2
README.md

@ -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)

14
bin/ws.js

@ -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

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