Skip to content

Commit

Permalink
help changes
Browse files Browse the repository at this point in the history
  • Loading branch information
omphalos committed Jul 30, 2012
1 parent bcd2e21 commit dcaed7c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
31 changes: 17 additions & 14 deletions bin/crud-file-server
Expand Up @@ -3,23 +3,26 @@
var argv = require('optimist').argv;
var server = require('../crud-file-server');

if(argv.h) {
console.log('usage: crud-file-server [options]');
if(!argv.q) {
console.log('usage:');
console.log(' crud-file-server [options]');
console.log('');
console.log('starts a subproxy server using the specified command-line options');
console.log('(if you run with localhost, make sure to modify your hosts file!)');
console.log('this starts a file server server using the specified command-line options.');
console.log('');
console.log('options:');
console.log('');
console.log(' -f: file system path to expose over http');
console.log(' -p: port to listen on (example, 80)');
console.log(' -h: this help message');
} else {
var port = argv.p || 80;
var path = argv.f || __dirname;

require('http').createServer(function (req, res) {
server.handleRequest(port, path, req, res);
}).listen(port);

console.log('listening on port ' + port + ', serving directory ' + path);
console.log(' -q: suppress this message');
console.log('');
}

var port = argv.p || 80;
var path = argv.f || __dirname;

require('http').createServer(function (req, res) {
server.handleRequest(port, path, req, res);
}).listen(port);

console.log('server started');
console.log('listening on port ' + port + ', serving directory ' + path);
2 changes: 0 additions & 2 deletions crud-file-server.js
Expand Up @@ -6,8 +6,6 @@ var cleanUrl = function(url) {
return url;
};

console.log('**************************************');

exports.handleRequest = function(port, path, req, res) {
var writeError = function (err, code) {
console.log('writeError-->');
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "crud-file-server",
"version": "0.0.1",
"version": "0.0.2",
"description": "basic file server supporting create, read, update, & delete",
"bin": {
"crud-file-server": "./bin/crud-file-server"
Expand Down

0 comments on commit dcaed7c

Please sign in to comment.