diff options
Diffstat (limited to 'serve.py')
-rw-r--r-- | serve.py | 12 |
1 files changed, 12 insertions, 0 deletions
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() |