import http.server import socketserver import os import webbrowser from pathlib import Path PORT = 8080 DIRECTORY = Path(__file__).parent class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory=str(DIRECTORY), **kwargs) def start_server(): with socketserver.TCPServer(("", PORT), CustomHTTPRequestHandler) as httpd: print(f"🧠 N8N AI Integration Hub running at http://localhost:{PORT}") print("Press Ctrl+C to stop the server") webbrowser.open(f"http://localhost:{PORT}") httpd.serve_forever() if __name__ == "__main__": start_server()