Skip to content

Instantly share code, notes, and snippets.

@pwittchen

pwittchen/server.py

Created Jul 24, 2020
Embed
What would you like to do?
dummy python server
from http.server import BaseHTTPRequestHandler, HTTPServer
host="localhost" ; port=8080
class HTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200) ; self.end_headers() ; self.wfile.write(b'ok')
print("http server is running at " + host + ":" + str(port))
HTTPServer((host, port), HTTPRequestHandler).serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.