Open raw ↗import http.server
import socketserver
import os
os.chdir(r'C:\AI Projects\Investment plans\projects\Kais Project\MVP')
PORT = 8081
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/' or self.path == '/index.html':
self.path = '/HAD_Digital_Standalone.html'
return super().do_GET()
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print(f"Serving standalone at http://localhost:{PORT}")
httpd.serve_forever()