Skip to content

Instantly share code, notes, and snippets.

@toolness
Created April 27, 2012 15:57
Show Gist options
  • Save toolness/2510367 to your computer and use it in GitHub Desktop.
Save toolness/2510367 to your computer and use it in GitHub Desktop.
A simple python server that busts it out from the current dir
#! /usr/bin/python
import os
import BaseHTTPServer
import SimpleHTTPServer
PORT = 8001
types = {
'.manifest': 'text/cache-manifest',
'.webm': 'video/webm'
}
SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map.update(types)
def run(server_class=BaseHTTPServer.HTTPServer,
handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler,
port=PORT):
server_address = ('', port)
print "Serving files in '%s' on port %d." % (os.getcwd(), port)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()
if __name__ == '__main__':
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment