diff --git a/ezweb.py b/ezweb.py index 528f78c..e52d54f 100644 --- a/ezweb.py +++ b/ezweb.py @@ -1,3 +1,5 @@ +port = 8080 + import os import sys path = os.path.dirname(sys.argv[0]) @@ -7,10 +9,10 @@ css = os.listdir(f"{path}/css") from http.server import SimpleHTTPRequestHandler, HTTPServer -# Custom handler class to serve "Hello, World!" at /test +# main loop class MyHandler(SimpleHTTPRequestHandler): def do_GET(self): - # Check if the request path is /test + # makes index work if self.path == "/": selfpath = "index" else: @@ -18,7 +20,7 @@ class MyHandler(SimpleHTTPRequestHandler): paths = f"{selfpath}.html" if paths.replace("/","") in html: - # Respond with a 200 status code + @@ -71,7 +73,8 @@ class MyHandler(SimpleHTTPRequestHandler): self.send_header('Content-type', 'text/html') self.end_headers() - # The content of the webpage + # Merge all the files together procedrealy + # todo: make compiler verson of this content = f"""