From 60f5373baa1901d3a8f5856abe291017b2d71f15 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Mon, 13 Jan 2025 19:39:31 +0300 Subject: [PATCH] test --- main.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index bcc656f..c12bc19 100644 --- a/main.py +++ b/main.py @@ -59,5 +59,15 @@ def get_port(subdomain: str): if __name__ == "__main__": - with FrontDemoDaemon('/tmp/front-demo-daemon.pid', error_log_file='/var/log/daemon_logs/front-demo-daemon.txt') as front: - front.process_command() + webServer = HTTPServer((hostName, serverPort), MyServer) + print(f"Server started http://{hostName}:{serverPort}") + + try: + webServer.serve_forever() + except KeyboardInterrupt: + pass + + webServer.server_close() + print("Http server stopped.") + # with FrontDemoDaemon('/tmp/front-demo-daemon.pid', error_log_file='/var/log/daemon_logs/front-demo-daemon.txt') as front: + # front.process_command()