]> git.scottworley.com Git - hellowebpy/blame_incremental - hellowebpy.py
Follow nixpkgs rename: checkInputs → nativeCheckInputs
[hellowebpy] / hellowebpy.py
... / ...
CommitLineData
1from http.server import BaseHTTPRequestHandler, HTTPServer
2
3listen_address = ('', 8080)
4
5
6class 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
14def main() -> None:
15 webServer = HTTPServer(listen_address, HelloServer)
16 webServer.serve_forever()
17
18
19if __name__ == "__main__":
20 main()