File size: 573 Bytes
2eba1b3
 
b358645
2eba1b3
 
 
 
 
b358645
2eba1b3
 
 
b358645
2eba1b3
 
 
 
 
b358645
2eba1b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()