Доработка. Рефактор

This commit is contained in:
sasha80
2025-11-08 11:04:31 +03:00
parent 379504994c
commit 91b79266df
2 changed files with 19 additions and 0 deletions

17
https-server.py Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
from http import server # Python 3
import ssl
import os
class MyHTTPRequestHandler(server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if __name__ == '__main__':
html_dir = os.path.join(os.path.dirname(__file__), 'html')
os.chdir(html_dir)
srv = server.HTTPServer(('', 8000), MyHTTPRequestHandler)
sdc = ssl.create_default_context()
srv.serve_forever()