Spaces:
Runtime error
Runtime error
File size: 498 Bytes
2725a85 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from http.server import SimpleHTTPRequestHandler, HTTPServer
class RequestHandler(SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory='./', **kwargs)
def run(server_class=HTTPServer, handler_class=RequestHandler, port=8000):
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f'Starting httpd on port {port}...')
httpd.serve_forever()
if __name__ == '__main__':
run()
|