21 lines
493 B
Python
Executable File
21 lines
493 B
Python
Executable File
#!/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()
|