2019-05-29 07:44:10 -07:00

20 lines
429 B
Python
Executable File

#!/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()