Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ability to stop server
fixed some typos in comments
  • Loading branch information
andrewpthorp committed Mar 28, 2012
1 parent f0c35f5 commit fa043d6
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/server.js
Expand Up @@ -8,7 +8,7 @@
*/
(function(){

var SWITCHES, BANNER, colors, libs, config, printLine;
var SWITCHES, BANNER, colors, libs, config, printLine, server;

colors = require('colors');

Expand Down Expand Up @@ -61,7 +61,7 @@
}

// Fire off the server!
libs.http.createServer(function(request, response) {
server = libs.http.createServer(function(request, response) {

var url = libs.url.parse(request.url, true),
file = decodeURIComponent(url.pathname),
Expand Down Expand Up @@ -128,12 +128,25 @@

};

/*
* stop
*
* Stop the current server (if it is running)
*
* @author Andrew Thorp
*/
exports.stop = function(){
if (server){
server.close();
}
}

/*
* usage
*
* print the help screen
*
* @author Andrew thorp
* @author Andrew Thorp
*/
var usage = function(){
var lines, spaces, i, len, switchLength, currSwitch, spaces, shortFlag, longFlag;
Expand Down Expand Up @@ -166,7 +179,7 @@
* log a string (used for requests)
*
* @variable string (if not passed, connection string is printed)
* @author Andrew thorp
* @author Andrew Thorp
*/
var logString = function(string){
if (config.nologs) return;
Expand Down

0 comments on commit fa043d6

Please sign in to comment.