Skip to content

Instantly share code, notes, and snippets.

View respectTheCode's full-sized avatar

Kevin Smith respectTheCode

  • Playlister
  • Indianapolis, IN
View GitHub Profile
@respectTheCode
respectTheCode / static_server.js
Created February 27, 2012 20:36 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mime = require("mime")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname