diff --git a/server.py b/server.py index 0b364bd..d14590e 100644 --- a/server.py +++ b/server.py @@ -8,7 +8,12 @@ class C(H): def do_GET(self): p = self.path if p.endswith("/"): - p += "index.html" + base_path = p.rstrip("/") + html_file = base_path + ".html" + if os.path.exists(os.path.join(os.getcwd(), html_file.lstrip("/"))): + p = html_file + else: + p += "index.html" elif "." not in p.split("/")[-1]: r = os.path.join(os.getcwd(), p.lstrip("/")) if os.path.exists(r + ".html"):