This commit is contained in:
2025-03-31 00:22:21 +03:00
commit 38f2a05107
146 changed files with 66771 additions and 0 deletions

31
web/server.py Normal file
View File

@@ -0,0 +1,31 @@
import os
from http.server import HTTPServer, SimpleHTTPRequestHandler
# Default error message template
DEFAULT_ERROR_MESSAGE = """\
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Single Page Apps for GitHub Pages</title>
<script>
sessionStorage.redirect = location.href;
</script>
<meta http-equiv="refresh" content="0;URL='/'">
</head>
<body>
</body>
</html>
"""
class MyHandler(SimpleHTTPRequestHandler):
def send_error(self, code, message=None):
if code == 404:
self.error_message_format = DEFAULT_ERROR_MESSAGE
SimpleHTTPRequestHandler.send_error(self, code, message)
if __name__ == '__main__':
httpd = HTTPServer(('', 4002), MyHandler)
print("Serving app on port 4002 ...")
httpd.serve_forever()