Spaces:
Runtime error
Runtime error
import sys | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
class S(BaseHTTPRequestHandler): | |
def _set_headers(self): | |
self.send_response(200) | |
self.send_header('Content-type', 'application/json') | |
self.end_headers() | |
def do_GET(self): | |
self._set_headers() | |
self.wfile.write(b"") | |
def run_dummy_server(server_class=HTTPServer, handler_class=S, port=7860): | |
server_address = ('', port) | |
httpd = server_class(server_address, handler_class) | |
print('Starting httpd...') | |
httpd.serve_forever() | |
run_dummy_server() |