Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Aug 13, 2013
0 parents commit 5ec6eb0
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

node_modules
npm-debug.log

#Ignore sublime files

#*.sublime-project
#*.sublime-workspace

#Ignore Azure package crap
local_package*
*.cspkg
*.logs

#Ignore IISNode stuff
*.debug

*.DS_Store
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
instant-server
=======

instant-server turns any directory into an instant file server, and it runs directly from your command line. Install it once per machine and then run it in as many directories as you'd like.

## HTTP Conventions

* __GET__ - reads the contents a file from the specified path
* __POST__ - append the contents of a file
* __PUT__ - overwrite the contents of a file
* __DELETE__ - delete a file from the system
4 changes: 4 additions & 0 deletions lib/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var http = require("http");

var argv = process.argv.slice(2);
console.log(argv);
12 changes: 12 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "instant-server"
, "description":"an instant file server that you can run anywhere from the command line"
, "version": "0.1.0"
, "dependencies" : {
"argparse" : "~0.1.15"
},
, "author": "Aaron Stannard <aaron@aaronstannard.com>"
, "homepage": "https://github.com/Aaronontheweb/node-slugs"
, "main": "app.js"
, "keywords": ["server", "instant", "files", "fileserver", "file server"]
}
33 changes: 33 additions & 0 deletions lib/util/args.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* file: args.js
* description: used to process command-line arguments for instant-server
* author: Aaron Stannard
* created: 8/12/2013
* last-modified: 8/12/2013
*/

"use strict";
var ArgumentParser = require("argparse").ArgumentParser;
var parser = new ArgumentParser({
version: "0.1.0",
addHelp: true,
description: 'instant-server'
});

parser.addArgument(
['-d','--dir'],
{
help: 'the root directory for the server to service its requests',
nargs: 1,
required: false
}
);

parser.addArgument(
['-r','--readonly'],
{
help: 'put the server in read-only mode',
nargs: 0,
required: false
}
);

0 comments on commit 5ec6eb0

Please sign in to comment.