Initial commit

This commit is contained in:
2025-11-13 22:46:11 +03:00
commit 7231349e96
7 changed files with 63 additions and 0 deletions

32
nginx-python/src/main.py Normal file
View File

@ -0,0 +1,32 @@
from http.server import BaseHTTPRequestHandler, HTTPServer
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
html_content = """
<!DOCTYPE html>
<html>
<head>
<title>Meow</title>
</head>
<body>
<h1>I'm cat so meow</h1>
<p>The current time is: {}</p>
</body>
</html>
""".format(self.date_time_string())
self.wfile.write(html_content.encode('utf-8'))
def run(server_class=HTTPServer, handler_class=MyHandler, port=4422):
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f'Starting httpd server on port {port}...')
httpd.serve_forever()
if __name__ == '__main__':
run()