From a0a4920deaf4ca645cdfee45edf00e614369882f Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 25 May 2023 21:54:37 +0200 Subject: initial commit --- serve.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 serve.py (limited to 'serve.py') diff --git a/serve.py b/serve.py new file mode 100644 index 0000000..3a43cc4 --- /dev/null +++ b/serve.py @@ -0,0 +1,12 @@ +from http.server import * +import os +import subprocess + +class MyHandler(SimpleHTTPRequestHandler): + def send_head(self): + path = self.translate_path(self.path) + path = os.path.relpath(path) + subprocess.run(["make", path]) + return super().send_head() + +HTTPServer(("localhost", 8080), MyHandler).serve_forever() -- cgit 1.4.1-2-gfad0