diff --git a/local_server.py b/local_server.py deleted file mode 100644 index a9147c5..0000000 --- a/local_server.py +++ /dev/null @@ -1,34 +0,0 @@ -from SimpleHTTPServer import SimpleHTTPRequestHandler -import SocketServer -import os - - -class SPARequestHandler(SimpleHTTPRequestHandler): - def send_head(self): - self.path = self.path.lstrip('/app') - path = self.translate_path(self.path) - f = None - if os.path.isdir(path): - for index in "index.html", "index.htm": - index = os.path.join(path, index) - if os.path.exists(index): - path = index - break - else: - return self.list_directory(path) - ctype = self.guess_type(path) - if ctype.startswith('text/'): - mode = 'r' - else: - mode = 'rb' - try: - f = open(path, mode) - except IOError: - return open('home.html', 'r') - self.send_response(200) - self.send_header("Content-type", ctype) - self.end_headers() - return f - -httpd = SocketServer.TCPServer(("", 80), SPARequestHandler) -httpd.serve_forever() \ No newline at end of file