import http.server
import socketserver
import os


def run_server(port: int = 8000):
    """
    Simple static file server to serve the webclienttest directory.
    """
    base_dir = os.path.dirname(os.path.abspath(__file__))
    os.chdir(base_dir)

    handler = http.server.SimpleHTTPRequestHandler

    with socketserver.TCPServer(("", port), handler) as httpd:
        print(f"Serving webclienttest on http://localhost:{port}/")
        print("\nAvailable clients:")
        # print(f"  - Supporter: http://localhost:{port}/index.html")
        # print(f"  - NUP: http://localhost:{port}/nup_client.html")
        print(f"  - Combined: http://localhost:{port}/client.html")
        print("\nPress Ctrl+C to stop.")
        httpd.serve_forever()


if __name__ == "__main__":
    run_server()


