4
0

python html server for web export

This commit is contained in:
Zsolt Tasnadi
2025-12-04 12:54:45 +01:00
parent 90a1ff79fd
commit 9bab0b08bc
2 changed files with 23 additions and 0 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
.local .local
.vscode .vscode
.DS_Store
bomberman.zip
bomberman/*

20
serve.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
"""Simple static file server for Bomberman HTML export."""
import http.server
import socketserver
import os
import webbrowser
PORT = 3333
DIRECTORY = "bomberman"
os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), DIRECTORY))
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
url = f"http://localhost:{PORT}"
print(f"Serving at {url}")
webbrowser.open(url)
httpd.serve_forever()