]> git.scottworley.com Git - hellowebpy/blob - hellowebpy.py
113911cef2f0bcea8a14e6ec560dc30ced4efe73
[hellowebpy] / hellowebpy.py
1 from http.server import BaseHTTPRequestHandler, HTTPServer
2
3 listen_address = ('', 8080)
4
5
6 class HelloServer(BaseHTTPRequestHandler):
7 def do_GET(self) -> None:
8 self.send_response(200)
9 self.send_header("Content-type", "text/html")
10 self.end_headers()
11 self.wfile.write(bytes("<html><body>Hello Web</body></html>", "utf-8"))
12
13
14 def main() -> None:
15 webServer = HTTPServer(listen_address, HelloServer)
16 webServer.serve_forever()
17
18
19 if __name__ == "__main__":
20 main()