#!/usr/bin/python import SimpleHTTPServer import SocketServer import os PORT = 8000 public_dir = os.path.join(os.path.dirname(__file__), '..', 'public') os.chdir(public_dir) Handler = SimpleHTTPServer.SimpleHTTPRequestHandler Handler.extensions_map.update({ '': 'text/html', }); httpd = SocketServer.TCPServer(("", PORT), Handler) print("Serving Go by Example at http://127.0.0.1:{}".format(PORT)) httpd.serve_forever()